Initializer (Default implementation)swift 6.0.1Swift
init(exactly:)
Creates a new value, if the given integer can be represented exactly.
init?<Source>(exactly value: Source) where Source : BinaryInteger
Parameters
- value
The integer to convert to a floating-point value.
If the given integer cannot be represented exactly, the result is nil
.
Implements
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.
init?<T>(exactly: T
) Creates a new instance from the given integer, if it can be represented exactly.
Other members in extension
Type members
init<Source>(Source
) Creates a new value, rounded to the closest possible representation.
static func random(in: ClosedRange<Self>
) -> Self Returns a random value within the specified range.
static func random(in: Range<Self>
) -> Self Returns a random value within the specified range.
static func random<T>(in: ClosedRange<Self>, using: inout T
) -> Self Returns a random value within the specified range, using the given generator as a source for randomness.
static func random<T>(in: Range<Self>, using: inout T
) -> Self Returns a random value within the specified range, using the given generator as a source for randomness.