---
title: "isLessThanOrEqualTo(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/float/islessthanorequalto(_:)"
---

# isLessThanOrEqualTo(_:)

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

## Declaration

```swift
func isLessThanOrEqualTo(_ other: Float) -> Bool
```

## Parameters

- `other`: The value to compare with this value.

## Return Value

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

## Discussion

Discussion This method serves as the basis for the less-than-or-equal-to operator (<=) for floating-point values. Some special cases apply: Because NaN is incomparable with any value, this method returns false when called on NaN or when NaN is passed as other. -infinity compares less than or equal to all values except NaN. Every value except NaN compares less than or equal to +infinity. The following example shows the behavior of the isLessThanOrEqualTo(_:) method with different kinds of values: let x = 15.0 x.isLessThanOrEqualTo(20.0) // true x.isLessThanOrEqualTo(.nan) // false Double.nan.isLessThanOrEqualTo(x) // false The isLessThanOrEqualTo(_:) method implements the less-than-or-equal predicate defined by the IEEE 754 specification.

## See Also

### Comparing Values

- [Floating-Point Operators for Float](swift/floating-point-operators-for-float.md)
- [isEqual(to:)](swift/float/isequal(to:).md)
- [isLess(than:)](swift/float/isless(than:).md)
- [isTotallyOrdered(belowOrEqualTo:)](swift/float/istotallyordered(beloworequalto:).md)
- [maximum(_:_:)](swift/float/maximum(_:_:).md)
- [maximumMagnitude(_:_:)](swift/float/maximummagnitude(_:_:).md)
- [minimum(_:_:)](swift/float/minimum(_:_:).md)
- [minimumMagnitude(_:_:)](swift/float/minimummagnitude(_:_:).md)
