<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Float/ulp",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:Sf3ulpSfvp"
  },
  "title" : "ulp"
}
-->

# ulp

The unit in the last place of this value.

```
var ulp: Float { get }
```

## Discussion

This is the unit of the least significant digit in this value’s
significand. For most numbers `x`, this is the difference between `x`
and the next greater (in magnitude) representable number. There are some
edge cases to be aware of:

- If `x` is not a finite number, then `x.ulp` is NaN.
- If `x` is very small in magnitude, then `x.ulp` may be a subnormal
  number. If a type does not support subnormals, `x.ulp` may be rounded
  to zero.
- `greatestFiniteMagnitude.ulp` is a finite number, even though the next
  greater representable value is `infinity`.

See also the `ulpOfOne` static property.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)