mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-25 19:56:30 +00:00
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.
This commit is contained in:
50
tests/test-float.lst.ok
Normal file
50
tests/test-float.lst.ok
Normal file
@@ -0,0 +1,50 @@
|
||||
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)
|
||||
@@ -26,3 +26,7 @@
|
||||
.flt4 72057594037927936 ; 056200 000000 000000 000000
|
||||
|
||||
.flt4 72057594037927937 ; 056200 000000 000000 000001
|
||||
|
||||
.flt4 144115188075855873 ; 1 << 57 +1
|
||||
; 056400 000000 000000 000000 (rounded!)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user