log10
Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.2See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0)) // 1.0
println(log10(1.0)) // 0.0
println(log10(1000.0)) // 3.0
// Special cases
println(log10(Double.NaN)) // NaN
println(log10(-1.0)) // NaN
println(log10(0.0)) // -Infinity
println(log10(Double.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.2See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0f)) // 1.0
println(log10(1.0f)) // 0.0
println(log10(1000.0f)) // 3.0
// Special cases
println(log10(Float.NaN)) // NaN
println(log10(-1.0f)) // NaN
println(log10(0.0f)) // -Infinity
println(log10(Float.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.2See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0)) // 1.0
println(log10(1.0)) // 0.0
println(log10(1000.0)) // 3.0
// Special cases
println(log10(Double.NaN)) // NaN
println(log10(-1.0)) // NaN
println(log10(0.0)) // -Infinity
println(log10(Double.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.2See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0f)) // 1.0
println(log10(1.0f)) // 0.0
println(log10(1000.0f)) // 3.0
// Special cases
println(log10(Float.NaN)) // NaN
println(log10(-1.0f)) // NaN
println(log10(0.0f)) // -Infinity
println(log10(Float.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.2See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0)) // 1.0
println(log10(1.0)) // 0.0
println(log10(1000.0)) // 3.0
// Special cases
println(log10(Double.NaN)) // NaN
println(log10(-1.0)) // NaN
println(log10(0.0)) // -Infinity
println(log10(Double.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.2See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0f)) // 1.0
println(log10(1.0f)) // 0.0
println(log10(1000.0f)) // 3.0
// Special cases
println(log10(Float.NaN)) // NaN
println(log10(-1.0f)) // NaN
println(log10(0.0f)) // -Infinity
println(log10(Float.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.3See also
actual function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0)) // 1.0
println(log10(1.0)) // 0.0
println(log10(1000.0)) // 3.0
// Special cases
println(log10(Double.NaN)) // NaN
println(log10(-1.0)) // NaN
println(log10(0.0)) // -Infinity
println(log10(Double.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.3See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0f)) // 1.0
println(log10(1.0f)) // 0.0
println(log10(1000.0f)) // 3.0
// Special cases
println(log10(Float.NaN)) // NaN
println(log10(-1.0f)) // NaN
println(log10(0.0f)) // -Infinity
println(log10(Float.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.8See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0)) // 1.0
println(log10(1.0)) // 0.0
println(log10(1000.0)) // 3.0
// Special cases
println(log10(Double.NaN)) // NaN
println(log10(-1.0)) // NaN
println(log10(0.0)) // -Infinity
println(log10(Double.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.8See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0f)) // 1.0
println(log10(1.0f)) // 0.0
println(log10(1000.0f)) // 3.0
// Special cases
println(log10(Float.NaN)) // NaN
println(log10(-1.0f)) // NaN
println(log10(0.0f)) // -Infinity
println(log10(Float.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.8See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0)) // 1.0
println(log10(1.0)) // 0.0
println(log10(1000.0)) // 3.0
// Special cases
println(log10(Double.NaN)) // NaN
println(log10(-1.0)) // NaN
println(log10(0.0)) // -Infinity
println(log10(Double.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}Computes the common logarithm (base 10) of the value x.
Since Kotlin
1.8See also
function for special cases.
Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
println(log10(10.0f)) // 1.0
println(log10(1.0f)) // 0.0
println(log10(1000.0f)) // 3.0
// Special cases
println(log10(Float.NaN)) // NaN
println(log10(-1.0f)) // NaN
println(log10(0.0f)) // -Infinity
println(log10(Float.POSITIVE_INFINITY)) // Infinity
//sampleEnd
}