Required Initializerswift 6.0.1Swift
init(_:)
Creates a new instance from the given value, rounded to the closest possible representation.
init(_ value: Float)
Parameters
- value
A floating-point value to be converted.
Other requirements
View members
Hide members
This section is hidden by default because it contains too many (12) members.
Type members
associatedtype RawExponent
A type that represents the encoded exponent of a value.
associatedtype RawSignificand
A type that represents the encoded significand of a value.
init(Double
) Creates a new instance from the given value, rounded to the closest possible representation.
init<Source>(Source
) Creates a new instance from the given value, rounded to the closest possible representation.
init?<Source>(exactly: Source
) Creates a new instance from the given value, if it can be represented exactly.
init(sign: FloatingPointSign, exponentBitPattern: Self.RawExponent, significandBitPattern: Self.RawSignificand
) Creates a new instance from the specified sign and bit patterns.
static var exponentBitCount: Int
The number of bits used to represent the type’s exponent.
static var significandBitCount: Int
The available number of fractional significand bits.
Instance members
var binade: Self
The floating-point value with the same sign and exponent as this value, but with a significand of 1.0.
var exponentBitPattern: Self.RawExponent
The raw encoding of the value’s exponent field.
var significandBitPattern: Self.RawSignificand
The raw encoding of the value’s significand field.
var significandWidth: Int
The number of bits required to represent the value’s significand.
Citizens in Swift
Default implementations
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.