The Double.exponent
property of a value of type double in Swift is the exponent of a floating-point value. When we speak of exponents, we are referring to the integer part of the logarithm of the value’s magnitude.
Double.exponent
The value returned is the exponent of the double value. This returned value is an integer.
// create some double valueslet d1 = 12.44let d2 = 1.23333let d3 = 100.1let d4 = 1.0// print the exponentsprint(d1.exponent)print(d2.exponent)print(d3.exponent)print(d4.exponent)
In the code above,