diff --git a/asklyphe-frontend/src/math.rs b/asklyphe-frontend/src/math.rs index 16c3412..fc7b224 100644 --- a/asklyphe-frontend/src/math.rs +++ b/asklyphe-frontend/src/math.rs @@ -81,6 +81,18 @@ enum Atom { Const(Const), } +impl Atom { + fn get_val(&self) -> f64 { + match self { + Atom::Number(val) => *val, + Atom::Const(c) => match c { + Const::Pi => 3.141592653589793238462643383279, + Const::E => 2.718281828459045235360287471352, + } + } + } +} + #[derive(Debug, Copy, Clone)] enum Func { Sine,