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:
バイナリ浮動小数点型のもつexponent
は、正規化数の、有限の値に対する指数の範囲に限界を課します。ある型F
の指数バイアスは、以下のように計算されます、ここで**
は冪です:
let bias = 2 ** (F.exponentBitCount - 1) - 1
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.
型F
の最小正規化指数は、1 - bias
です、最大有限指数はbias
です。全てゼロの指数は非正規化数とゼロのために予約されます、そして全て1の指数は無限大とNaNのために予約されます。
For example, the Float
type has an exponent
of 8, which gives an exponent bias of 127
by the calculation above.
例えば、Float
型は、8のexponent
を持ちます、それは127
の指数バイアスを上記の計算によって与えます。
let bias = 2 ** (Float.exponentBitCount - 1) - 1
// bias == 127
print(Float.greatestFiniteMagnitude.exponent)
// Prints "127"
print(Float.leastNormalMagnitude.exponent)
// Prints "-126"
Note 注意
This documentation comment was inherited from Binary
.
この文書化コメントは、Binary
から引き継がれました。