open-simh.simtools/tests/test-float.lst.ok
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

51 lines
2.8 KiB
Plaintext

1 ;;;;;
2 ;
3 ; Test floating point numbers
4
5 000000 040200 .word ^F 1.0 ; 040200
6 000002 140200 .word ^F-1.0 ; 140200
7 000004 137600 .word -^F 1.0 ; 137600
8 000006 037600 .word -^F-1.0 ; 037600
9
10 000010 040706 .word ^F6.2 ; 040706
11 000012 137071 .word ^C^F6.2 ; 137071
12 000014 137071 .word ^C<^F6.2> ; 137071
13
14 000016 040706 063146 .flt2 6.2 ; 040706 063146
15 000022 040706 063146 063146 .flt4 6.2 ; 040706 063146 063146 063146
000030 063146
16
17 000032 040300 000000 .flt2 1.5 ; 040300 000000
18 000036 040300 000000 000000 .flt4 1.5 ; 040300 000000 000000 000000
000044 000000
19
20 000046 056200 .word ^F 72057594037927935 ; 056200 (rounded!)
21 000050 056200 000000 .flt2 72057594037927935 ; 056200 000000 (rounded!)
22 000054 056177 177777 177777 .flt4 72057594037927935 ; 056177 177777 177777 177777 (exact!)
000062 177777
23
24 000064 056200 .word ^F 72057594037927936 ; 056200
25 000066 056200 000000 .flt2 72057594037927936 ; 056200 000000
26 000072 056200 000000 000000 .flt4 72057594037927936 ; 056200 000000 000000 000000
000100 000000
27
28 000102 056200 000000 000000 .flt4 72057594037927937 ; 056200 000000 000000 000001
000110 000000
29
30 000112 056400 000000 000000 .flt4 144115188075855873 ; 1 << 57 +1
000120 000000
31 ; 056400 000000 000000 000000 (rounded!)
32
32
Symbol table
. ******R 001
Program sections:
. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV)
000122 001 (RW,I,LCL,REL,CON,NOSAV)