We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d971e6 commit f56c40fCopy full SHA for f56c40f
src/math/generic/ceil.rs
@@ -25,15 +25,15 @@ pub fn ceil<F: Float>(x: F) -> F {
25
26
// Otherwise, raise an inexact exception.
27
force_eval!(x + F::MAX);
28
- if x.is_sign_negative() {
+ if x.is_sign_positive() {
29
ix += m;
30
}
31
ix &= !m;
32
} else {
33
// No integer part, raise an inexact exception since truncation will happen.
34
35
36
- if x.is_sign_positive() {
+ if x.is_sign_negative() {
37
return F::NEG_ZERO;
38
} else if ix << 1 != zero {
39
return F::ONE;
0 commit comments