aboutsummaryrefslogtreecommitdiffstats
path: root/src/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/input.rs')
-rw-r--r--src/input.rs4
1 files changed, 3 insertions, 1 deletions
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::<f64>() {