From 8756ace462ab94e540d53c633b7e76c21b7a6bcd Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Mon, 13 Mar 2023 21:32:05 -0230 Subject: inverse trig functions --- src/input.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index dbfe763..4de615f 100644 --- a/src/input.rs +++ b/src/input.rs @@ -32,7 +32,9 @@ impl Calculator { } KeyCode::Enter => { if let Ok(func) = Function::parse(&self.input_buffer) { - self.call_function(func); + if let Some(val) = self.stack.pop() { + self.stack.push(func.call(val, self.angle_mode)); + } } else if let Ok(c) = Constant::parse(&self.input_buffer) { self.stack.push(c.value()); } else if let Ok(bu) = self.input_buffer.parse::() { -- cgit v1.2.3