From 98b454bb930166b0b7f05adaa4dd479d7c734c0c Mon Sep 17 00:00:00 2001 From: elcharitas Date: Mon, 13 Feb 2023 00:38:32 +0100 Subject: [PATCH] fix: improve factorial unsafe parse --- src/interpreter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interpreter.rs b/src/interpreter.rs index b24780b..ba4038f 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -75,7 +75,7 @@ impl<'a> Interpreter<'a> { Expression::Power(left, right) => { let left = self.evaluate_expression(*left)?; let right = self.evaluate_expression(*right)?; - Ok(left.powf(right.try_into().unwrap())) + Ok(left.powf(right)) } Expression::None => Ok(0.0), }