<!--
{
  "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/Double/isLess(than:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:Sd6isLess4thanSbSd_tF"
  },
  "title" : "isLess(than:)"
}
-->

# isLess(than:)

Returns a Boolean value indicating whether this instance is less than the
given value.

```
func isLess(than other: Double) -> Bool
```

## Parameters

`other`

The value to compare with this value.

## Return Value

`true` if this value is less than `other`; otherwise, `false`.
If either this value or `other` is NaN, the result of this method is
`false`.

## Discussion

This method serves as the basis for the less-than operator (`<`) for
floating-point values. Some special cases apply:

- Because NaN compares not less than nor greater than any value, this
  method returns `false` when called on NaN or when NaN is passed as
  `other`.
- `-infinity` compares less than all values except for itself and NaN.
- Every value except for NaN and `+infinity` compares less than
  `+infinity`.

The following example shows the behavior of the `isLess(than:)` method
with different kinds of values:

```
let x = 15.0
x.isLess(than: 20.0)
// true
x.isLess(than: .nan)
// false
Double.nan.isLess(than: x)
// false
```

The `isLess(than:)` method implements the less-than predicate defined by
the [IEEE 754 specification](http://ieeexplore.ieee.org/servlet/opac?punumber=4610933).

---

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)