Instance Property

significand

The significand of the floating-point value.

Required.

Declaration

var significand: Self { get }

Discussion

The magnitude of a floating-point value x of type F can be calculated by using the following formula, where ** is exponentiation:

let magnitude = x.significand * F.radix ** x.exponent

In the next example, y has a value of 21.5, which is encoded as 1.34375 * 2 ** 4. The significand of y is therefore 1.34375.

let y: Double = 21.5
// y.significand == 1.34375
// y.exponent == 4
// Double.radix == 2

If a type’s radix is 2, then for finite nonzero numbers, the significand is in the range 1.0 ..< 2.0. For other values of x, x.significand is defined as follows:

  • If x is zero, then x.significand is 0.0.

  • If x is infinity, then x.significand is 1.0.

  • If x is NaN, then x.significand is NaN.