diff options
author | Ivan Tham <[email protected]> | 2019-08-03 06:56:32 +0100 |
---|---|---|
committer | Ivan Tham <[email protected]> | 2019-08-03 07:15:43 +0100 |
commit | 051f0e40bdd3157902fd5e94f71f9747ad2fb72c (patch) | |
tree | a31cb6711c4aed59216d8fdd2956d9069a62c3d6 /src/main.rs | |
parent | 6c38d9b13b8e1cc976f9b22d15d100fd03ee54d4 (diff) |
Add constants (e, pi)
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 99d2059..c3f3342 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -192,6 +192,11 @@ mod tests { | |||
192 | assert_eq!(90., evaled); | 192 | assert_eq!(90., evaled); |
193 | } | 193 | } |
194 | #[test] | 194 | #[test] |
195 | fn sigmoid_fns() { | ||
196 | let evaled = eval_math_expression("1 / (1 + e^-7)", 0f64).unwrap(); | ||
197 | assert_eq!(0.9990889488, evaled); | ||
198 | } | ||
199 | #[test] | ||
195 | fn prev_ans() { | 200 | fn prev_ans() { |
196 | let evaled = eval_math_expression("_ + 9", 9f64).unwrap(); | 201 | let evaled = eval_math_expression("_ + 9", 9f64).unwrap(); |
197 | assert_eq!(18.0, evaled); | 202 | assert_eq!(18.0, evaled); |