> For the complete documentation index, see [llms.txt](https://fixed.onepub.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fixed.onepub.dev/comparison.md).

# Comparison

## Comparison

Fixed supports a full set of comparison operators:

```
== - equals
<  - less than
>  - greater than
<= - less than or equal
>= - greater than or equal
!= - not equal
```

When comparing two Fixed values the two values will first be scaled so that both values have the same scale. The larger scale from the two values will be used.

Example 7

```dart
final t1 = Fixed.fromNum(1.23);
final t2 = Fixed.fromInt(123, scale: 2);
final t3 = Fixed.fromBigInt(BigInt.from(1234), scale: 3);

expect(t1 == t2, isTrue);
expect(t1 < t3, isTrue);
expect(t1 <= t3, isTrue);
expect(t1 > t3, isFalse);
expect(t1 >= t3, isFalse);
expect(t1 != t3, isTrue);
expect(-t1, equals(Fixed.fromInt(-123, scale: 2)));

expect(t1.isPositive, isTrue);
expect(t1.isNegative, isFalse);
expect(t1.isZero, isFalse);

```

Fixed also supports the compareTo method allowing Fixed values to be sorted.

```
expect(t1.compareTo(t2), equals(0));
```
