summaryrefslogtreecommitdiff
path: root/float_test2.bpl
diff options
context:
space:
mode:
Diffstat (limited to 'float_test2.bpl')
-rw-r--r--float_test2.bpl20
1 files changed, 12 insertions, 8 deletions
diff --git a/float_test2.bpl b/float_test2.bpl
index da74909b..d78c339d 100644
--- a/float_test2.bpl
+++ b/float_test2.bpl
@@ -1,13 +1,17 @@
//Translation from addsub_float_exact.c
//Should Verify
+
+function {:builtin "(_ to_fp 8 24) RNE"} TO_FLOAT32_INT(int) returns (float32);
+function {:builtin "(_ to_fp 8 24) RNE"} TO_FLOAT32_REAL(real) returns (float32);
+
procedure main() returns () {
- var x : float;
- var y : float;
- var z : float;
- var r : float;
- x := fp(1000000);
- y := x + fp(1);
- z := x - fp(1);
+ var x : float32;
+ var y : float32;
+ var z : float32;
+ var r : float32;
+ x := TO_FLOAT32_REAL(1e7);
+ y := x + TO_FLOAT32_INT(1);
+ z := x - TO_FLOAT32_INT(1);
r := y - z;
- assert r == fp(2);
+ assert r == TO_FLOAT32_INT(2);
} \ No newline at end of file