Skip to content

Commit

Permalink
Merge pull request #1676 from GaloisInc/T1663-roundAway-reference-eval
Browse files Browse the repository at this point in the history
Fix `roundAway` implementation in reference evaluator
  • Loading branch information
yav authored Jun 1, 2024
2 parents 3ff9a82 + f380e10 commit 22d3277
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cryptol/Eval/Reference.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ by corresponding type classes:
> (eitherToE . FP.floatToInteger "trunc" FP.ToZero))
>
> , "roundAway" ~> unary (roundUnary roundAwayRat
> (eitherToE . FP.floatToInteger "roundAway" FP.Away))
> (eitherToE . FP.floatToInteger "roundAway" FP.NearAway))
>
> , "roundToEven"~> unary (roundUnary round
> (eitherToE . FP.floatToInteger "roundToEven" FP.NearEven))
Expand Down
12 changes: 12 additions & 0 deletions tests/issues/issue1663.icry
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:module Float
let x = 3.5 : Float32
:eval floor x
floor x
:eval ceiling x
ceiling x
:eval trunc x
trunc x
:eval roundToEven x
roundToEven x
:eval roundAway x
roundAway x
13 changes: 13 additions & 0 deletions tests/issues/issue1663.icry.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Loading module Cryptol
Loading module Cryptol
Loading module Float
3
3
4
4
3
3
4
4
4
4

0 comments on commit 22d3277

Please sign in to comment.