Add get_val

This commit is contained in:
Book-reader 2025-09-05 19:39:48 +12:00
parent 849393fbd1
commit 25644b9d4e

View file

@ -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,