---
title: "init(floatLiteral:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/expressiblebyfloatliteral/init(floatliteral:)"
---

# init(floatLiteral:)

Creates an instance initialized to the specified floating-point value.

## Declaration

```swift
init(floatLiteral value: Self.FloatLiteralType)
```

## Parameters

- `value`: The value to create.

## Discussion

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.
