Guest User

Untitled

a guest
May 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #[test]
  2. fn floor_negative() {
  3. // With parentheses around the number, this works.
  4. assert_eq!((-1.01f64).floor(), -2.0);
  5.  
  6. // Without parentheses, the meaning is "the negation of `1.01f64.floor()`"
  7. // which gives a different answer.
  8. assert_eq!(-1.01f64.floor(), -1.0);
  9. }
Add Comment
Please, Sign In to add comment