<!--
{
  "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/FloatingPoint/isZero",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SF6isZeroSbvp"
  },
  "title" : "isZero"
}
-->

# isZero

A Boolean value indicating whether the instance is equal to zero.

```
var isZero: Bool { get }
```

## Discussion

The `isZero` property of a value `x` is `true` when `x` represents either
`-0.0` or `+0.0`. `x.isZero` is equivalent to the following comparison:
`x == 0.0`.

```
let x = -0.0
x.isZero        // true
x == 0.0        // true
```

---

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)