Skip to content

Commit d5d500f

Browse files
committed
relax nan tests
1 parent e727703 commit d5d500f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

libm/src/math/fmin_fmax.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ mod tests {
140140
(F::NEG_NAN, F::NEG_ONE, F::NEG_ONE),
141141
(F::NEG_NAN, F::INFINITY, F::INFINITY),
142142
(F::NEG_NAN, F::NEG_INFINITY, F::NEG_INFINITY),
143-
(F::NEG_NAN, F::NEG_NAN, F::NEG_NAN),
144143
];
145144

146145
for (x, y, res) in cases {
@@ -153,6 +152,7 @@ mod tests {
153152
assert_eq!(f(F::NEG_ZERO, F::ZERO), F::ZERO);
154153
assert!(f(F::NAN, F::NEG_NAN).is_nan());
155154
assert!(f(F::NEG_NAN, F::NAN).is_nan());
155+
assert!(f(F::NEG_NAN, F::NEG_NAN).is_nan());
156156
}
157157

158158
#[test]
@@ -238,7 +238,6 @@ mod tests {
238238
(F::NEG_NAN, F::NEG_ONE, F::NEG_ONE),
239239
(F::NEG_NAN, F::INFINITY, F::INFINITY),
240240
(F::NEG_NAN, F::NEG_INFINITY, F::NEG_INFINITY),
241-
(F::NEG_NAN, F::NEG_NAN, F::NEG_NAN),
242241
];
243242

244243
for (x, y, res) in cases {
@@ -251,6 +250,7 @@ mod tests {
251250
assert_eq!(f(F::NEG_ZERO, F::ZERO), F::ZERO);
252251
assert!(f(F::NAN, F::NEG_NAN).is_nan());
253252
assert!(f(F::NEG_NAN, F::NAN).is_nan());
253+
assert!(f(F::NEG_NAN, F::NEG_NAN).is_nan());
254254
}
255255

256256
#[test]

libm/src/math/fminimum_fmaximum.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ mod tests {
8080
(F::ZERO, F::INFINITY, F::ZERO),
8181
(F::ZERO, F::NEG_INFINITY, F::NEG_INFINITY),
8282
(F::ZERO, F::NAN, F::NAN),
83-
(F::ZERO, F::NEG_NAN, F::NEG_NAN),
8483
(F::NEG_ZERO, F::ZERO, F::NEG_ZERO),
8584
(F::NEG_ZERO, F::NEG_ZERO, F::NEG_ZERO),
8685
(F::NEG_ZERO, F::ONE, F::NEG_ZERO),
@@ -145,6 +144,7 @@ mod tests {
145144
// Ordering between NaNs does not matter
146145
assert!(f(F::NAN, F::NEG_NAN).is_nan());
147146
assert!(f(F::NEG_NAN, F::NAN).is_nan());
147+
assert!(f(F::ZERO, F::NEG_NAN).is_nan());
148148
}
149149

150150
#[test]
@@ -178,7 +178,6 @@ mod tests {
178178
(F::ZERO, F::INFINITY, F::INFINITY),
179179
(F::ZERO, F::NEG_INFINITY, F::ZERO),
180180
(F::ZERO, F::NAN, F::NAN),
181-
(F::ZERO, F::NEG_NAN, F::NEG_NAN),
182181
(F::NEG_ZERO, F::ZERO, F::ZERO),
183182
(F::NEG_ZERO, F::NEG_ZERO, F::NEG_ZERO),
184183
(F::NEG_ZERO, F::ONE, F::ONE),
@@ -243,6 +242,7 @@ mod tests {
243242
// Ordering between NaNs does not matter
244243
assert!(f(F::NAN, F::NEG_NAN).is_nan());
245244
assert!(f(F::NEG_NAN, F::NAN).is_nan());
245+
assert!(f(F::ZERO, F::NEG_NAN).is_nan());
246246
}
247247

248248
#[test]

libm/src/math/fminimum_fmaximum_num.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ mod tests {
134134
(F::NEG_NAN, F::NEG_ONE, F::NEG_ONE),
135135
(F::NEG_NAN, F::INFINITY, F::INFINITY),
136136
(F::NEG_NAN, F::NEG_INFINITY, F::NEG_INFINITY),
137-
(F::NEG_NAN, F::NEG_NAN, F::NEG_NAN),
138137
];
139138

140139
for (x, y, expected) in cases {
@@ -145,6 +144,7 @@ mod tests {
145144
// Ordering between NaNs does not matter
146145
assert!(f(F::NAN, F::NEG_NAN).is_nan());
147146
assert!(f(F::NEG_NAN, F::NAN).is_nan());
147+
assert!(f(F::NEG_NAN, F::NEG_NAN).is_nan());
148148
}
149149

150150
#[test]
@@ -232,7 +232,6 @@ mod tests {
232232
(F::NEG_NAN, F::NEG_ONE, F::NEG_ONE),
233233
(F::NEG_NAN, F::INFINITY, F::INFINITY),
234234
(F::NEG_NAN, F::NEG_INFINITY, F::NEG_INFINITY),
235-
(F::NEG_NAN, F::NEG_NAN, F::NEG_NAN),
236235
];
237236

238237
for (x, y, expected) in cases {
@@ -243,6 +242,7 @@ mod tests {
243242
// Ordering between NaNs does not matter
244243
assert!(f(F::NAN, F::NEG_NAN).is_nan());
245244
assert!(f(F::NEG_NAN, F::NAN).is_nan());
245+
assert!(f(F::NEG_NAN, F::NEG_NAN).is_nan());
246246
}
247247

248248
#[test]

0 commit comments

Comments
 (0)