added pi and Euler's number as constants
This commit is contained in:
parent
6ffd55a637
commit
b086186949
2 changed files with 8 additions and 0 deletions
3
src/global.rs
Normal file
3
src/global.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
pub const EULER: f64 = 2.718;
|
||||
pub const PI: f64 = 3.14;
|
|
@ -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)),
|
||||
|
||||
|
|
Loading…
Reference in a new issue