summaryrefslogtreecommitdiff
path: root/Binaries
diff options
context:
space:
mode:
authorGravatar qunyanm <unknown>2016-04-01 14:36:56 -0700
committerGravatar qunyanm <unknown>2016-04-01 14:36:56 -0700
commit074172a069d77888f232d44660b72e07579296ae (patch)
tree168f2f345b4844c87a6d5bdfba39a3d6cc7a0fca /Binaries
parent31b0c4345b02b2314ca92a032ce90fbfdf66d1e8 (diff)
Fix issue 148. The results for sign comparison for BigRational.CompareTo was
wrong.
Diffstat (limited to 'Binaries')
-rw-r--r--Binaries/DafnyRuntime.cs8
1 files changed, 4 insertions, 4 deletions
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);