Compute Decimal Logarithm
Examples
Filter
console.log(Math.log10(100000));
// expected output: 5
console.log(Math.log10(2));
// expected output: 0.3010299956639812
console.log(Math.log10(1));
// expected output: 0
console.log(Math.log10(0));
// expected output: -Infinity
Math.log10(2); // 0.3010299956639812
Math.log10(1); // 0
Math.log10(0); // -Infinity
Math.log10(-2); // NaN
Math.log10(100000); // 5
package main
import (
"fmt"
"math"
)
func main() {
fmt.Printf("%.1f", math.Log10(100))
}