math.log10
Defined in module
"math"from "math" import log10Returns the base-10 logarithm of x
Parameters
x | number | the number to take the logarithm of |
Return value
The base-10 logarithm of x, as a float.
Notes
The result is always a float, even when x is an integer: type(log10(100)) is "float".
log10(0) does not throw. It returns negative infinity. A negative x does not throw either; it returns NaN. Both print differently between compilers and platforms, so do not print them from portable code.
Example
from "math" import log10
println("log10(100) =", log10(100))
println("log10(2) =", log10(2))
// the result is a float even when x is an integer
println("type(log10(100)) =", type(log10(100)))Output:
log10(100) = 2
log10(2) = 0.30103
type(log10(100)) = floatSee also
log | Returns the natural logarithm of x |
exp | Returns e raised to the power of x |
pow | Returns x raised to the power y |
| math | module index |