protocol
ExpressibleByFloatLiteral
Inheritance | View Protocol Hierarchy → |
---|---|
Associated Types |
A type that can represent a floating-point literal. Valid types for |
Import |
|
Initializers
Creates an instance initialized to the specified floating-point value.
Declaration
init
(
floatLiteral
value
:
Self
.
FloatLiteralType
)
A type that can be initialized with a floating-point literal.
The standard library floating-point types---
Float
,Double
, andFloat80
where available---all conform to theExpressibleByFloatLiteral
protocol. You can initialize a variable or constant of any of these types by assigning a floating-point literal.Conforming to ExpressibleByFloatLiteral
To add
ExpressibleByFloatLiteral
conformance to your custom type, implement the required initializer.