Skip to content

Commit 194e645

Browse files
committed
Add explicit test case for common quickcheck failure
1 parent ab3034b commit 194e645

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/float/add.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,22 @@ mod test {
261261
assert_eq!(r, 1f64 + 1f64);
262262
}
263263

264+
#[test]
265+
fn test_float_tiny_plus_large() {
266+
let a = f32::from_repr(1);
267+
let b = f32::from_repr(4286990935);
268+
let r = super::__addsf3(a, b);
269+
assert_eq!(r.repr(), (a + b).repr());
270+
}
271+
272+
#[test]
273+
fn test_double_tiny_plus_large() {
274+
let a = f64::from_repr(1);
275+
let b = f64::from_repr(4286990935);
276+
let r = super::__adddf3(a, b);
277+
assert_eq!(r.repr(), (a + b).repr());
278+
}
279+
264280
#[test]
265281
fn test_float_nan() {
266282
let r = super::__addsf3(f32::NAN, 1.23);

0 commit comments

Comments
 (0)