problem with floor function #59388
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
There appears to be an unexpected behaviour with the floor function for f64 (likely f32 as well). When applied to values greater than -1.0 and less than 0.0, it returns 0.0 instead of -1.0. That is, it is rounding up (ceil) rather than down in this one range of values.
assert_eq!(-0.8f64.floor(), -1f64);
The text was updated successfully, but these errors were encountered: