diff --git a/src/global.rs b/src/global.rs new file mode 100644 index 0000000..1de2458 --- /dev/null +++ b/src/global.rs @@ -0,0 +1,3 @@ + +pub const EULER: f64 = 2.718; +pub const PI: f64 = 3.14; diff --git a/src/main.rs b/src/main.rs index ceadcc1..22352bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,7 @@ use termion::{ style }; +mod global; mod helper; mod util; @@ -28,6 +29,10 @@ pub const VERSION: &str = "0.1.5"; fn main() { let mut context = context_map! { + // globals + "e" => global::EULER, + "pi" => global::PI, + // data science functions "avg" => Function::new(|arg| helper::average(arg)),