Initializer

init(integerLiteral:)

Creates a new value from the given integer literal.

Declaration

init(integerLiteral value: Int64)

Parameters

value

The new value.

Discussion

Do not call this initializer directly. It is used by the compiler when you create a new Double instance by using an integer literal. Instead, create a new value by using a literal.

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

let x: Double = 100
// x == 100.0

Relationships

See Also

Infrequently Used Functionality

init()

Creates a value initialized to zero.

init(floatLiteral: Double)

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

init(integerLiteral: Double)

Creates an instance initialized to the specified integer value.

func advanced(by: Double) -> Double

Returns a new value advanced by the given distance.

func distance(to: Double) -> Double

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.