Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 7ebf006

Browse files
committed
Add a test that overflow does not happen
1 parent 294c850 commit 7ebf006

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libm/src/math/floorf.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ pub fn floorf(x: f32) -> f32 {
3737
}
3838
return f32::from_bits(ui);
3939
}
40+
41+
#[cfg(test)]
42+
mod tests {
43+
#[test]
44+
fn no_overflow() {
45+
assert_eq!(super::floorf(0.5), 0.0);
46+
}
47+
}

0 commit comments

Comments
 (0)