Fix ceil implementation in NativeFloat64
This commit is contained in:
parent
d0df27a55c
commit
30b68d4992
@ -70,9 +70,10 @@ impl Number for Fixed {
|
|||||||
fn ceil_mut(&mut self, dps: usize) {
|
fn ceil_mut(&mut self, dps: usize) {
|
||||||
// Only do something if truncating
|
// Only do something if truncating
|
||||||
if dps < get_dps() {
|
if dps < get_dps() {
|
||||||
self.0 += IBig::one();
|
self.0 -= IBig::one();
|
||||||
let factor = IBig::from(10).pow(get_dps() - dps);
|
let factor = IBig::from(10).pow(get_dps() - dps);
|
||||||
self.0 /= &factor;
|
self.0 /= &factor;
|
||||||
|
self.0 += IBig::one();
|
||||||
self.0 *= factor;
|
self.0 *= factor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user