Fixed missing functionality in dashu with their methods still has some issue with move

This commit is contained in:
Fayeed Pawaskar
2023-07-21 14:21:32 +05:30
parent cf345d8174
commit b4e7000eb2
12 changed files with 328 additions and 97 deletions

View File

@@ -1387,7 +1387,7 @@ impl MachineState {
Ok(Number::Float(_)) => {
return type_error(arity);
}
Ok(Number::Rational(n)) if n.denom() != &1 => {
Ok(Number::Rational(n)) if !n.denominator().is_one() => {
return type_error(arity);
}
Ok(n) if n > MAX_ARITY => {
@@ -1400,7 +1400,7 @@ impl MachineState {
let err = self.domain_error(DomainErrorType::NotLessThanZero, n);
return Err(self.error_form(err, stub_gen()));
}
Ok(Number::Rational(n)) => n.numer().to_i64().unwrap(),
Ok(Number::Rational(n)) => n.numerator().to_i64().unwrap(),
Ok(Number::Fixnum(n)) => n.get_num(),
Ok(Number::Integer(n)) => n.to_i64().unwrap(),
Err(_) => {