fix floor for f64 (#1223)

This commit is contained in:
Mark Thom
2022-01-17 22:04:10 -07:00
parent 97b9d488d4
commit b980ae1e8c
2 changed files with 40 additions and 40 deletions

View File

@@ -345,7 +345,7 @@ impl<'a> ArithmeticEvaluator<'a> {
pub(crate) fn rnd_i<'a>(n: &'a Number, arena: &mut Arena) -> Number {
match n {
&Number::Integer(_) | &Number::Fixnum(_) => *n,
&Number::Float(OrderedFloat(f)) => fixnum!(Number, f.round() as i64, arena),
&Number::Float(OrderedFloat(f)) => fixnum!(Number, f.floor() as i64, arena),
&Number::Rational(ref r) => {
let r_ref = r.fract_floor_ref();
let (mut fract, mut floor) = (Rational::new(), Integer::new());