Initializer

init(integerLiteral:)

Creates an instance initialized to the specified integer value.

Declaration

init(integerLiteral value: Float)

Parameters

value

The value to create.

Discussion

Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal. For example:

let x = 23

In this example, the assignment to the x constant calls this integer literal initializer behind the scenes.

See Also

Infrequently Used Functionality

init()

Creates a value initialized to zero.

init(integerLiteral: Int64)

Creates a new value from the given integer literal.

init(floatLiteral: Float)

Creates a new value from the given floating-point literal.

func advanced(by: Float) -> Float

Returns a new value advanced by the given distance.

func distance(to: Float) -> Float

Returns the distance from this value to the specified value.

func write<Target>(to: inout Target)

Writes a textual representation of this instance into the given output stream.