open-simh.simtools/tests/test-float.mac
Olaf Seibert 8aea1498c5 For now, solve the precision problem with brute force,
by using long double where available.
Unfortunately, it won't be available everywhere, so a better solution
would still be nice.
Also, sometimes rounding of smaller sizes doesn't work right yet.
2021-01-19 09:39:02 +01:00

33 lines
1.1 KiB
Plaintext

;;;;;
;
; Test floating point numbers
.word ^F 1.0 ; 040200
.word ^F-1.0 ; 140200
.word -^F 1.0 ; 137600
.word -^F-1.0 ; 037600
.word ^F6.2 ; 040706
.word ^C^F6.2 ; 137071
.word ^C<^F6.2> ; 137071
.flt2 6.2 ; 040706 063146
.flt4 6.2 ; 040706 063146 063146 063146
.flt2 1.5 ; 040300 000000
.flt4 1.5 ; 040300 000000 000000 000000
.word ^F 72057594037927935 ; 056200 (rounded!)
.flt2 72057594037927935 ; 056200 000000 (rounded!)
.flt4 72057594037927935 ; 056177 177777 177777 177777 (exact!)
.word ^F 72057594037927936 ; 056200
.flt2 72057594037927936 ; 056200 000000
.flt4 72057594037927936 ; 056200 000000 000000 000000
.flt4 72057594037927937 ; 056200 000000 000000 000001
.flt4 144115188075855873 ; 1 << 57 +1
; 056400 000000 000000 000000 (rounded!)