Initializer

init(floatLiteral:)

Creates an instance initialized to the specified floating-point value. 指定された浮動小数点値に初期化されるインスタンスを作成します。

Declaration 宣言

init(floatLiteral value: Self.FloatLiteralType)

Parameters パラメータ

value

The value to create. 作成されることになる値。

Discussion 解説

Do not call this initializer directly. Instead, initialize a variable or constant using a floating-point literal. For example: このイニシャライザを直接に呼ばないでください。代わりに、浮動小数点リテラルを使って変数や定数を初期化してください。例えば:


let x = 21.5

In this example, the assignment to the x constant calls this floating-point literal initializer behind the scenes. この例において、x定数への代入は、この浮動小数点リテラルイニシャライザを舞台裏で呼びます。