The number of bits used to represent the type’s exponent.
Required.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
Discussion
A binary floating-point type’s exponent
imposes a limit on the range of the exponent for normal, finite values. The exponent bias of a type F
can be calculated as the following, where **
is exponentiation:
The least normal exponent for values of the type F
is 1 - bias
, and the largest finite exponent is bias
. An all-zeros exponent is reserved for subnormals and zeros, and an all-ones exponent is reserved for infinity and NaN.
For example, the Float
type has an exponent
of 8, which gives an exponent bias of 127
by the calculation above.