This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +73
-2
lines changed Expand file tree Collapse file tree 1 file changed +73
-2
lines changed Original file line number Diff line number Diff line change 46
46
if n > exp_max {
47
47
x *= f_exp_max;
48
48
n -= exp_max;
49
- if n > exp_max {
49
+
50
+ if F :: BITS < 32 && n > exp_max {
51
+ x *= f_exp_max;
52
+ n -= exp_max;
53
+
54
+ if n > exp_max {
55
+ x *= f_exp_max;
56
+ n -= exp_max;
57
+ if n > exp_max {
58
+ x *= f_exp_max;
59
+ n -= exp_max;
60
+ if n > exp_max {
61
+ x *= f_exp_max;
62
+ n -= exp_max;
63
+ if n > exp_max {
64
+ n = exp_max;
65
+ }
66
+ }
67
+ }
68
+ }
69
+ } else if n > exp_max {
50
70
n = exp_max;
51
71
}
52
72
}
59
79
if n < exp_min {
60
80
x *= mul;
61
81
n += add;
62
- if n < exp_min {
82
+ if F :: BITS < 32 {
83
+ if n < exp_min {
84
+ x *= mul;
85
+ n += add;
86
+
87
+ if n < exp_min {
88
+ x *= mul;
89
+ n += add;
90
+
91
+ if n < exp_min {
92
+ x *= mul;
93
+ n += add;
94
+
95
+ if n < exp_min {
96
+ x *= mul;
97
+ n += add;
98
+
99
+ if n < exp_min {
100
+ x *= mul;
101
+ n += add;
102
+
103
+ if n < exp_min {
104
+ x *= mul;
105
+ n += add;
106
+
107
+ if n < exp_min {
108
+ x *= mul;
109
+ n += add;
110
+
111
+ if n < exp_min {
112
+ n = exp_min;
113
+ }
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ } else if n < exp_min {
63
122
n = exp_min;
64
123
}
65
124
}
@@ -111,6 +170,12 @@ mod tests {
111
170
assert ! ( scalbn( -F :: NAN , -10 ) . is_nan( ) ) ;
112
171
}
113
172
173
+ #[ test]
174
+ #[ cfg( f16_enabled) ]
175
+ fn spec_test_f16 ( ) {
176
+ spec_test :: < f16 > ( ) ;
177
+ }
178
+
114
179
#[ test]
115
180
fn spec_test_f32 ( ) {
116
181
spec_test :: < f32 > ( ) ;
@@ -120,4 +185,10 @@ mod tests {
120
185
fn spec_test_f64 ( ) {
121
186
spec_test :: < f64 > ( ) ;
122
187
}
188
+
189
+ #[ test]
190
+ #[ cfg( f128_enabled) ]
191
+ fn spec_test_f128 ( ) {
192
+ spec_test :: < f128 > ( ) ;
193
+ }
123
194
}
You can’t perform that action at this time.
0 commit comments