Skip to content

Commit 672ef5c

Browse files
committed
Test for a "tricky" case from MMIX.
1 parent 027de7e commit 672ef5c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ml-proto/test/float_misc.wast

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
;; section 3.3.1: A typical problem: "double rounding"
7474
(assert_return (invoke "f64.add" (f64.const 0x1p+63) (f64.const 1024.25)) (f64.const 0x1.0000000000001p+63))
7575

76+
;; Test a case that was "tricky" on MMIX.
77+
;; http://mmix.cs.hm.edu/bugs/bug_rounding.html
78+
(assert_return (invoke "f64.add" (f64.const -0x1p-1008) (f64.const 0x0.0000000001716p-1022)) (f64.const -0x1.fffffffffffffp-1009))
79+
7680
;; Test adding the greatest value to 1.0 that rounds back to 1.0, and the
7781
;; least that rounds to something greater.
7882
(assert_return (invoke "f64.add" (f64.const 1.0) (f64.const 0x1p-53)) (f64.const 0x1.0p+0))

0 commit comments

Comments
 (0)