Initializer

init(_:)

Creates a new instance that approximates the given value.

Declaration

init(_ value: CGFloat)

Parameters

value

The value to use for the new instance.

Discussion

The value of value is rounded to a representable value, if necessary. A NaN passed as value results in another NaN, with a signaling NaN value converted to quiet NaN.

See Also

Converting Floating-Point Values

init<Source>(Source)

Creates a new instance from the given value, rounded to the closest possible representation.

init<Source>(Source)

Creates a new value, rounded to the closest possible representation.

init(Double)

Creates a new instance that approximates the given value.

init(Float)

Creates a new instance initialized to the given value.

init(Float80)

Creates a new instance that approximates the given value.

init(signOf: Float, magnitudeOf: Float)

Creates a new floating-point value using the sign of one value and the magnitude of another.

init(sign: FloatingPointSign, exponent: Int, significand: Float)

Creates a new value from the given sign, exponent, and significand.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software