summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Checkmate50 <dgeisler50@gmail.com>2015-10-14 13:02:48 -0600
committerGravatar Checkmate50 <dgeisler50@gmail.com>2015-10-14 13:02:48 -0600
commita3b2bfa16f991f4d5f844b6d18e836e57b4195a1 (patch)
treef765fbfaa513306a34aac8811a2749051718350a
parent0324757fb1a12d76861a51be988690bf8de75f64 (diff)
Floating point constants given as integers are now translated correctly
-rw-r--r--Source/Basetypes/BigFloat.cs2
-rw-r--r--float_test5.bpl2
2 files changed, 3 insertions, 1 deletions
diff --git a/Source/Basetypes/BigFloat.cs b/Source/Basetypes/BigFloat.cs
index 9e798959..bbc39db4 100644
--- a/Source/Basetypes/BigFloat.cs
+++ b/Source/Basetypes/BigFloat.cs
@@ -146,6 +146,8 @@ namespace Microsoft.Basetypes
this.mantissa = 0;
this.isDec = true;
this.dec_value = dec_value;
+ if (this.dec_value.IndexOf(".") == -1)
+ this.dec_value += ".0"; //Assures that the decimal value is a "real" number
}
private BIM maxMantissa()
diff --git a/float_test5.bpl b/float_test5.bpl
index 2661a736..be72b988 100644
--- a/float_test5.bpl
+++ b/float_test5.bpl
@@ -1,4 +1,4 @@
procedure F() returns () {
var x : float;
- assert x - x == fp(0.0);
+ assert x - x == fp(0);
} \ No newline at end of file