---
title: "distance(to:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/decimal/distance(to:)"
---

# distance(to:)

Returns the distance from this value to the specified value.

## Declaration

```swift
func distance(to other: Decimal) -> Decimal
```

## See Also

### Comparing decimals

- [isEqual(to:)](foundation/decimal/isequal(to:).md)
- [isLess(than:)](foundation/decimal/isless(than:).md)
- [isLessThanOrEqualTo(_:)](foundation/decimal/islessthanorequalto(_:).md)
- [isTotallyOrdered(belowOrEqualTo:)](foundation/decimal/istotallyordered(beloworequalto:).md)
- [advanced(by:)](foundation/decimal/advanced(by:).md)
- [NSDecimalCompare(_:_:)](foundation/nsdecimalcompare(_:_:).md)
