Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[test]
- fn floor_negative() {
- // With parentheses around the number, this works.
- assert_eq!((-1.01f64).floor(), -2.0);
- // Without parentheses, the meaning is "the negation of `1.01f64.floor()`"
- // which gives a different answer.
- assert_eq!(-1.01f64.floor(), -1.0);
- }
Add Comment
Please, Sign In to add comment