File tree 2 files changed +4
-16
lines changed
2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -147,18 +147,12 @@ pub fn gt(x: f32, y: f32) -> bool { return x > y; }
147
147
148
148
#[ inline( always) ]
149
149
pub fn fmax ( x : f32 , y : f32 ) -> f32 {
150
- if x. is_NaN ( ) { y }
151
- else if y. is_NaN ( ) { x }
152
- else if x > y { x }
153
- else { y }
150
+ if x >= y || y. is_NaN ( ) { x } else { y }
154
151
}
155
152
156
153
#[ inline( always) ]
157
154
pub fn fmin ( x : f32 , y : f32 ) -> f32 {
158
- if x. is_NaN ( ) { y }
159
- else if y. is_NaN ( ) { x }
160
- else if x < y { x }
161
- else { y }
155
+ if x <= y || y. is_NaN ( ) { x } else { y }
162
156
}
163
157
164
158
Original file line number Diff line number Diff line change @@ -172,18 +172,12 @@ pub fn gt(x: f64, y: f64) -> bool { return x > y; }
172
172
173
173
#[ inline( always) ]
174
174
pub fn fmax ( x : f64 , y : f64 ) -> f64 {
175
- if x. is_NaN ( ) { y }
176
- else if y. is_NaN ( ) { x }
177
- else if x > y { x }
178
- else { y }
175
+ if x >= y || y. is_NaN ( ) { x } else { y }
179
176
}
180
177
181
178
#[ inline( always) ]
182
179
pub fn fmin ( x : f64 , y : f64 ) -> f64 {
183
- if x. is_NaN ( ) { y }
184
- else if y. is_NaN ( ) { x }
185
- else if x < y { x }
186
- else { y }
180
+ if x <= y || y. is_NaN ( ) { x } else { y }
187
181
}
188
182
189
183
// FIXME (#1999): add is_normal, is_subnormal, and fpclassify
You can’t perform that action at this time.
0 commit comments