---
title: ExpressibleByFloatLiteral
framework: swift
role: symbol
role_heading: Protocol
path: swift/expressiblebyfloatliteral
---

# ExpressibleByFloatLiteral

A type that can be initialized with a floating-point literal.

## Declaration

```swift
protocol ExpressibleByFloatLiteral
```

## Overview

Overview The standard library floating-point types—Float, Double, and Float80 where available—all conform to the ExpressibleByFloatLiteral protocol. You can initialize a variable or constant of any of these types by assigning a floating-point literal. // Type inferred as 'Double' let threshold = 6.0

// An array of 'Double' let measurements = [2.2, 4.1, 3.65, 4.2, 9.1] Conforming to ExpressibleByFloatLiteral To add ExpressibleByFloatLiteral conformance to your custom type, implement the required initializer.

## Topics

### Associated Types

- [FloatLiteralType](swift/expressiblebyfloatliteral/floatliteraltype.md)

### Initializers

- [init(floatLiteral:)](swift/expressiblebyfloatliteral/init(floatliteral:).md)

## Relationships

### Inherited By

- [BinaryFloatingPoint](swift/binaryfloatingpoint.md)

### Conforming Types

- [Double](swift/double.md)
- [Float](swift/float.md)
- [Float16](swift/float16.md)
- [Float80](swift/float80.md)

## See Also

### Value Literals

- [ExpressibleByIntegerLiteral](swift/expressiblebyintegerliteral.md)
- [ExpressibleByBooleanLiteral](swift/expressiblebybooleanliteral.md)
- [ExpressibleByNilLiteral](swift/expressiblebynilliteral.md)
- [StaticBigInt](swift/staticbigint.md)
