exp
Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.2Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Double.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0).firstFiveDigits()) // 2.71828
println(exp(2.0).firstFiveDigits()) // 7.38905
println(exp(-1.0).firstFiveDigits()) // 0.36787
// special cases
println(exp(Double.NaN)) // NaN
println(exp(Double.POSITIVE_INFINITY)) // Infinity
println(exp(Double.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.2Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Float.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0f).firstFiveDigits()) // 2.71828
println(exp(2.0f).firstFiveDigits()) // 7.38905
println(exp(-1.0f).firstFiveDigits()) // 0.36787
// special cases
println(exp(Float.NaN)) // NaN
println(exp(Float.POSITIVE_INFINITY)) // Infinity
println(exp(Float.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.2Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Double.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0).firstFiveDigits()) // 2.71828
println(exp(2.0).firstFiveDigits()) // 7.38905
println(exp(-1.0).firstFiveDigits()) // 0.36787
// special cases
println(exp(Double.NaN)) // NaN
println(exp(Double.POSITIVE_INFINITY)) // Infinity
println(exp(Double.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.2Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Float.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0f).firstFiveDigits()) // 2.71828
println(exp(2.0f).firstFiveDigits()) // 7.38905
println(exp(-1.0f).firstFiveDigits()) // 0.36787
// special cases
println(exp(Float.NaN)) // NaN
println(exp(Float.POSITIVE_INFINITY)) // Infinity
println(exp(Float.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.2Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Double.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0).firstFiveDigits()) // 2.71828
println(exp(2.0).firstFiveDigits()) // 7.38905
println(exp(-1.0).firstFiveDigits()) // 0.36787
// special cases
println(exp(Double.NaN)) // NaN
println(exp(Double.POSITIVE_INFINITY)) // Infinity
println(exp(Double.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.2Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Float.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0f).firstFiveDigits()) // 2.71828
println(exp(2.0f).firstFiveDigits()) // 7.38905
println(exp(-1.0f).firstFiveDigits()) // 0.36787
// special cases
println(exp(Float.NaN)) // NaN
println(exp(Float.POSITIVE_INFINITY)) // Infinity
println(exp(Float.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.3Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Double.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0).firstFiveDigits()) // 2.71828
println(exp(2.0).firstFiveDigits()) // 7.38905
println(exp(-1.0).firstFiveDigits()) // 0.36787
// special cases
println(exp(Double.NaN)) // NaN
println(exp(Double.POSITIVE_INFINITY)) // Infinity
println(exp(Double.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.3Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Float.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0f).firstFiveDigits()) // 2.71828
println(exp(2.0f).firstFiveDigits()) // 7.38905
println(exp(-1.0f).firstFiveDigits()) // 0.36787
// special cases
println(exp(Float.NaN)) // NaN
println(exp(Float.POSITIVE_INFINITY)) // Infinity
println(exp(Float.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.8Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Double.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0).firstFiveDigits()) // 2.71828
println(exp(2.0).firstFiveDigits()) // 7.38905
println(exp(-1.0).firstFiveDigits()) // 0.36787
// special cases
println(exp(Double.NaN)) // NaN
println(exp(Double.POSITIVE_INFINITY)) // Infinity
println(exp(Double.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.8Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Float.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0f).firstFiveDigits()) // 2.71828
println(exp(2.0f).firstFiveDigits()) // 7.38905
println(exp(-1.0f).firstFiveDigits()) // 0.36787
// special cases
println(exp(Float.NaN)) // NaN
println(exp(Float.POSITIVE_INFINITY)) // Infinity
println(exp(Float.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.8Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Double.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0).firstFiveDigits()) // 2.71828
println(exp(2.0).firstFiveDigits()) // 7.38905
println(exp(-1.0).firstFiveDigits()) // 0.36787
// special cases
println(exp(Double.NaN)) // NaN
println(exp(Double.POSITIVE_INFINITY)) // Infinity
println(exp(Double.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}Computes Euler's number e raised to the power of the value x.
Special cases:
exp(NaN)isNaNexp(+Inf)is+Infexp(-Inf)is0.0
Since Kotlin
1.8Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
fun Float.firstFiveDigits(): String = toString().substring(0, 7)
println(exp(1.0f).firstFiveDigits()) // 2.71828
println(exp(2.0f).firstFiveDigits()) // 7.38905
println(exp(-1.0f).firstFiveDigits()) // 0.36787
// special cases
println(exp(Float.NaN)) // NaN
println(exp(Float.POSITIVE_INFINITY)) // Infinity
println(exp(Float.NEGATIVE_INFINITY)) // 0.0
//sampleEnd
}