diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2023-03-13 21:32:05 -0230 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2023-03-13 21:32:05 -0230 |
| commit | 8756ace462ab94e540d53c633b7e76c21b7a6bcd (patch) | |
| tree | 4ae8e0025aa8c25af8f15164ba06dd98f9a6324b /src/input.rs | |
| parent | c83c2315dd45bb0bc590995ea0899a0ebd1b59dc (diff) | |
| download | pfc-8756ace462ab94e540d53c633b7e76c21b7a6bcd.zip | |
inverse trig functions
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 4 |
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>() { |