From 0ef1b02ee04a5abbe05d047a46e5de33554b1410 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 30 Jan 2023 21:27:32 +0100 Subject: Add calc constants --- library/src/compute/calc.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'library/src') diff --git a/library/src/compute/calc.rs b/library/src/compute/calc.rs index 5f5c2b4a..d3319d76 100644 --- a/library/src/compute/calc.rs +++ b/library/src/compute/calc.rs @@ -30,6 +30,10 @@ pub fn calc() -> Module { scope.def_func::("even"); scope.def_func::("odd"); scope.def_func::("mod"); + scope.define("inf", Value::Float(f64::INFINITY)); + scope.define("nan", Value::Float(f64::NAN)); + scope.define("pi", Value::Float(std::f64::consts::PI)); + scope.define("e", Value::Float(std::f64::consts::E)); Module::new("calc").with_scope(scope) } -- cgit v1.2.3