Implemented num_order methods on Integer & Rational numbers

This commit is contained in:
Fayeed Pawaskar
2023-09-04 14:12:47 +05:30
parent cfd67c8337
commit 7b921fc767
10 changed files with 240 additions and 131 deletions

View File

@@ -872,8 +872,10 @@ impl MachineState {
}
}
Ok(Number::Integer(n)) => {
if let Some(n) = n.to_usize() {
printer.max_depth = n;
let result = n.value().try_into();
if let Ok(value) = result {
printer.max_depth = value;
} else {
self.fail = true;
return Ok(None);