Skip to content

Commit

Permalink
bump patch
Browse files Browse the repository at this point in the history
  • Loading branch information
zahash committed Oct 27, 2023
1 parent 5b369c4 commit 7f8969a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "csc"
version = "0.1.6"
version = "0.1.7"
edition = "2021"
authors = ["Zahash <[email protected]>"]
description = "Command Line Scientific Calculator"
Expand Down
10 changes: 7 additions & 3 deletions src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,19 @@ impl<'text> Eval<'text> for PostfixExpr<'text> {
("cot", [rad]) => Ok(rad.eval(state)?.tan().recip()),
("coth", [rad]) => Ok(rad.eval(state)?.tanh().recip()),
("acot", [rad]) => Ok(std::f64::consts::FRAC_PI_2 - rad.eval(state)?.atan()),
("acoth", [rad]) => Ok(0.5 * ( 2.0 /(rad.eval(state)? - 1.0)).ln_1p()),
("acoth", [rad]) => Ok(0.5 * (2.0 / (rad.eval(state)? - 1.0)).ln_1p()),
("sec", [rad]) => Ok(rad.eval(state)?.cos().recip()),
("sech", [rad]) => Ok(rad.eval(state)?.cosh().recip()),
("asec", [rad]) => Ok((rad.eval(state)?.recip()).acos()),
("asech", [rad]) => Ok((rad.eval(state)?.recip() + ((rad.eval(state)?).powi(-2) - 1.0_f64).sqrt()).ln()),
("asech", [rad]) => {
Ok((rad.eval(state)?.recip() + (rad.eval(state)?.powi(-2) - 1.0).sqrt()).ln())
}
("csc", [rad]) => Ok(rad.eval(state)?.sin().recip()),
("csch", [rad]) => Ok(rad.eval(state)?.sinh().recip()),
("acsc", [rad]) => Ok((rad.eval(state)?.recip()).asin()),
("acsch", [rad]) => Ok((rad.eval(state)?.recip() + ((rad.eval(state)?).powi(-2) + 1.0_f64).sqrt()).ln()),
("acsch", [rad]) => {
Ok((rad.eval(state)?.recip() + (rad.eval(state)?.powi(-2) + 1.0).sqrt()).ln())
}
_ => Err(EvalError::InvalidFnCall(format!("{}", self))),
},
}
Expand Down

0 comments on commit 7f8969a

Please sign in to comment.