O'Reilly logo

Go Standard Library Cookbook by Radomir Sohlich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The standard package, math, contains functions for all commonly used logarithms, and so you can easily get binary, decimal, and natural logarithms. See the Log function which counts any logarithm of y with base x through the helper-defined formula:

The internal implementation of the logarithm in standard lib is naturally based on approximation. This function can be seen in the $GOROOT/src/math/log.go file.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required