Skip to content

Commit

Permalink
fix: improve factorial unsafe parse
Browse files Browse the repository at this point in the history
  • Loading branch information
elcharitas committed Feb 12, 2023
1 parent a3631d5 commit 98b454b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down

0 comments on commit 98b454b

Please sign in to comment.