---
title: "init(exactly:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/float16/init(exactly:)-8rmd7"
---

# init(exactly:)

Creates a new instance initialized to the given value, if it can be represented without rounding.

## Declaration

```swift
init?(exactly other: Float)
```

## Parameters

- `other`: The value to use for the new instance.

## Discussion

Discussion If other can’t be represented as an instance of Float16 without rounding, the result of this initializer is nil. In particular, passing NaN as other always results in nil. let x: Float = 21.25 let y = Float16(exactly: x) // y == Optional.some(21.25)

let z = Float16(exactly: Float.nan) // z == nil
