From 5b364e104ed57eb18cda64de97216967a480aeac Mon Sep 17 00:00:00 2001 From: emma Date: Tue, 13 Feb 2024 16:57:29 -0700 Subject: [PATCH] rpn(1): fixed exponentiation --- src/rpn.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpn.rs b/src/rpn.rs index 0168972..0cb23b8 100644 --- a/src/rpn.rs +++ b/src/rpn.rs @@ -165,7 +165,7 @@ fn eval( Subtract => stack.push_back(y - x), Multiply => stack.push_back(y * x), Divide => stack.push_back(y / x), - Power => stack.push_back(x.powf(y)), + Power => stack.push_back(y.powf(x)), Floor => stack.push_back((y / x).floor()), Modulo => stack.push_back(y % x), _ => {},