Skip to content

Commit ce7dd93

Browse files
committed
Add a test that overflow does not happen
1 parent 9c4332e commit ce7dd93

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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)