Rework NFORMAT-ALL to avoid error in ratsubst. Patch contributed by Stavros Macrakis.
[maxima.git] / tests / ulp_tests.mac
blob029fe8ee0962d1e3ddcd5542275186520587d6b0
1 unit_in_last_place(0) ;
2 1 ;
4 unit_in_last_place(-534234) ;
5 1 ;
7 unit_in_last_place(2/3) ;
8 0 ;
10 unit_in_last_place(0.0b0) ;
11 0.0b0 ;
13 unit_in_last_place(0.0) - least_positive_float ;
14 0.0;
16 unit_in_last_place(2*unit_in_last_place(0.0)) - least_positive_float ;
17 0.0;
19 unit_in_last_place(unit_in_last_place(0.0)*(2^53+1)) - least_positive_float ;
20 0.0;
22 unit_in_last_place(unit_in_last_place(0.0)*(2^53+2)) - 2*least_positive_float ;
23 0.0;
25 2*unit_in_last_place(float((0+2^52)/2^1073)) - unit_in_last_place(float((1+2^52)/2^1073)) ;
26 0.0 ;
28 unit_in_last_place(1.0)-unit_in_last_place(.9999) ;
29 0.0 ;
31 unit_in_last_place(1.0001)-2*unit_in_last_place(1.0000) ;
32 0.0 ;
34 unit_in_last_place(1.0b0)-unit_in_last_place(.9999b0) ;
35 0.0b0 ;
37 unit_in_last_place(1.0001b0)-2*unit_in_last_place(1.0000b0) ;
38 0.0b0 ;
40 2.0^1023*(2.0-unit_in_last_place(2.0)) - largest_float ;
41 0.0 ;
43 unit_in_last_place(-1.0)-unit_in_last_place(1.0) ;
44 0.0 ;
46 is_power_of_two(0) ;
47 false ;
49 is_power_of_two(1) ;
50 true ;
52 is_power_of_two(1048576) ;
53 true ;
55 is_power_of_two(1048575) ;
56 false ;
58 is_power_of_two(1048577) ;
59 false ;
61 is_power_of_two(1/256) ;
62 true ;
64 is_power_of_two(1/384) ;
65 false ;
67 is_power_of_two(0.0e0) ;
68 false ;
70 is_power_of_two(1.0e0) ;
71 true ;
73 is_power_of_two(1048576.0e0) ;
74 true ;
76 is_power_of_two(1048575.0e0) ;
77 false ;
79 is_power_of_two(1048577.0e0) ;
80 false ;
82 is_power_of_two(1/256.0e0) ;
83 true ;
85 is_power_of_two(0.0b0) ;
86 false ;
88 is_power_of_two(1.0b0) ;
89 true ;
91 is_power_of_two(1048576.0b0) ;
92 true ;
94 is_power_of_two(1048575.0b0) ;
95 false ;
97 is_power_of_two(1048577.0b0) ;
98 false ;
100 is_power_of_two(1/256.0b0) ;
101 true ;