diff --git a/src/calc.rs b/src/calc.rs index 202e678..e83aeb1 100644 --- a/src/calc.rs +++ b/src/calc.rs @@ -283,7 +283,7 @@ impl Calculator { } 'E' => { let precision = self.checked_get(0)? as usize; - if precision >= 20 { + if precision > 20 { return Err(CalculatorError::PrecisionTooHigh); } self.display_mode = CalculatorDisplayMode::Engineering(self.pop_usize()?) @@ -406,6 +406,7 @@ impl Calculator { Ok(f) } pub fn pop_usize(&mut self) -> CalculatorResult { + self.flush_l()?; let f = self.checked_get(0)?; let ret = f as usize; self.direct_state_change(CalculatorStateChange {