diff options
author | Checkmate50 <dgeisler50@gmail.com> | 2016-05-31 12:08:07 -0600 |
---|---|---|
committer | Checkmate50 <dgeisler50@gmail.com> | 2016-05-31 12:08:07 -0600 |
commit | 6f7fc01346c0ebe9072e61ace2cfede4fcedea09 (patch) | |
tree | 6d55790d0180d5e8cf1a79ea03ad6ce3b2019f17 /float_test2.bpl | |
parent | 51b7e8146f413b83a412572fcc9e3a1a8b302b79 (diff) |
Initial round of testing works with new syntax. Fixed an error where floating points could not be given as a function argument
Diffstat (limited to 'float_test2.bpl')
-rw-r--r-- | float_test2.bpl | 20 |
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 |