ValidatedBinaryFloatingPoint
@available(swift 3.1)
public struct ValidatedBinaryFloatingPoint<Element> where Element : BinaryFloatingPoint
A ValidatedBinaryFloatingPoint
is a model type that holds a Numeric
value that has an associated valid
flag.
ValidatedBinaryFloatingPoint
provides feedback on validity of value
-
The value component of the
ValidatedBinaryFloatingPoint
.Declaration
Swift
public var value: Element
-
The validity of the
ValidatedBinaryFloatingPoint
.Declaration
Swift
public var valid: Bool
-
Create a
ValidatedBinaryFloatingPoint
given a specified value and unit.Declaration
Swift
public init(value: Element, valid: Bool)
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public var debugDescription: String { get }
-
Declaration
Swift
public var customMirror: Mirror { get }
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Encodes this value into the given encoder.
If the value fails to encode anything,
encoder
will encode an empty keyed container in its place.This function throws an error if any values are invalid for the given encoder’s format.
Declaration
Swift
public func encode(to encoder: Encoder) throws
Parameters
encoder
The encoder to write data to.