From 074172a069d77888f232d44660b72e07579296ae Mon Sep 17 00:00:00 2001 From: qunyanm Date: Fri, 1 Apr 2016 14:36:56 -0700 Subject: Fix issue 148. The results for sign comparison for BigRational.CompareTo was wrong. --- Binaries/DafnyRuntime.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Binaries') diff --git a/Binaries/DafnyRuntime.cs b/Binaries/DafnyRuntime.cs index 3002d832..587d5159 100644 --- a/Binaries/DafnyRuntime.cs +++ b/Binaries/DafnyRuntime.cs @@ -1253,13 +1253,13 @@ namespace Dafny int asign = this.num.Sign; int bsign = that.num.Sign; if (asign < 0 && 0 <= bsign) { - return 1; + return -1; } else if (asign <= 0 && 0 < bsign) { - return 1; - } else if (bsign < 0 && 0 <= asign) { return -1; + } else if (bsign < 0 && 0 <= asign) { + return 1; } else if (bsign <= 0 && 0 < asign) { - return -1; + return 1; } BigInteger aa, bb, dd; Normalize(this, that, out aa, out bb, out dd); -- cgit v1.2.3