Generic Initializer

init(exactly:)

Creates a new instance from the given value, if it can be represented exactly.

Required. Default implementation provided.

Declaration

init?<Source>(exactly value: Source) where Source : BinaryFloatingPoint

Parameters

value

A floating-point value to be converted.

Discussion

If the given floating-point value cannot be represented exactly, the result is nil. A value that is NaN (“not a number”) cannot be represented exactly if its payload cannot be encoded exactly.

Default Implementations

BinaryFloatingPoint Implementations

init?<Source>(exactly: Source)

Creates a new instance from the given value, if it can be represented exactly.

init?<Source>(exactly: Source)

Creates a new value, if the given integer can be represented exactly.