There is a bug in BigRational implementation as the following example, which produces `False` as output, shows:
```
method Main()
{
var zero : real := 0.0;
var fifteen : real := 15.0;
assert zero <= fifteen;
print zero <= fifteen, "\n";
}
```
The problem comes from *BigRational.CompareTo* in the Dafny prelude. As a solution, I propose to change the method like this:
```
public int CompareTo(BigRational that) {
BigInteger aa, bb, dd;
Normalize(this, that, out aa, out bb, out dd);
return aa.CompareTo(bb);
}
```
The sign comparisons are wrong but they are also unnecessary because *Normalize* respects the signs.
```
method Main()
{
var zero : real := 0.0;
var fifteen : real := 15.0;
assert zero <= fifteen;
print zero <= fifteen, "\n";
}
```
The problem comes from *BigRational.CompareTo* in the Dafny prelude. As a solution, I propose to change the method like this:
```
public int CompareTo(BigRational that) {
BigInteger aa, bb, dd;
Normalize(this, that, out aa, out bb, out dd);
return aa.CompareTo(bb);
}
```
The sign comparisons are wrong but they are also unnecessary because *Normalize* respects the signs.