init(_:)
Creates a new instance from the given value, rounded to the closest possible representation.
init(_ value: Double) Parameters
- value
A floating-point value to be converted.
Creates a new instance from the given value, rounded to the closest possible representation.
init(_ value: Double) A floating-point value to be converted.
import Swiftprotocol BinaryFloatingPoint : ExpressibleByFloatLiteral, FloatingPointA radix-2 (binary) floating-point type.
@frozen struct DoubleA double-precision, floating-point value type.
associatedtype RawExponent : UnsignedIntegerA type that represents the encoded exponent of a value.
associatedtype RawSignificand : UnsignedIntegerA type that represents the encoded significand of a value.
init(_ value: Float) Creates a new instance from the given value, rounded to the closest possible representation.
init<Source>(_ value: Source) where Source : BinaryFloatingPoint Creates a new instance from the given value, rounded to the closest possible representation.
init?<Source>(exactly value: Source) where Source : BinaryFloatingPoint 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 { get }The number of bits used to represent the type’s exponent.
static var significandBitCount: Int { get }The available number of fractional significand bits.
var binade: Self { get }The floating-point value with the same sign and exponent as this value, but with a significand of 1.0.
var exponentBitPattern: Self.RawExponent { get }The raw encoding of the value’s exponent field.
var significandBitPattern: Self.RawSignificand { get }The raw encoding of the value’s significand field.
var significandWidth: Int { get }The number of bits required to represent the value’s significand.
init<Source>(_ value: Source) where Source : BinaryFloatingPoint Creates a new instance from the given value, rounded to the closest possible representation.
init<Source>(_ value: Source) where Source : BinaryInteger Creates a new value, rounded to the closest possible representation.