Instance Property

significand

The significand of the floating-point value.

Declaration

var significand: Double { 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.

Relationships

From Protocol

See Also

Querying a Double

var ulp: Double

The unit in the last place of this value.

var exponent: Int

The exponent of the floating-point value.

var nextUp: Double

The least representable value that compares greater than this value.

var nextDown: Double

The greatest representable value that compares less than this value.

var binade: Double

The floating-point value with the same sign and exponent as this value, but with a significand of 1.0.