Skip to content

Commit

Permalink
const_pi and const_e added
Browse files Browse the repository at this point in the history
  • Loading branch information
Innokenty committed Nov 19, 2024
1 parent aeb8871 commit a1b2c0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/metta/runner/stdlib_minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1820,6 +1820,10 @@ pub fn register_common_tokens(tref: &mut Tokenizer, _tokenizer: Shared<Tokenizer
tref.register_token(regex(r"isnan-math"), move |_| { isnan_math_op.clone() });
let isinf_math_op = Atom::gnd(stdlib_math::IsInfMathOp{});
tref.register_token(regex(r"isinf-math"), move |_| { isinf_math_op.clone() });
tref.register_token(regex(r"const_pi"),
|_| { Atom::gnd(Number::Float(std::f64::consts::PI)) });
tref.register_token(regex(r"const_e"),
|_| { Atom::gnd(Number::Float(std::f64::consts::E)) });

#[cfg(feature = "pkg_mgmt")]
pkg_mgmt_ops::register_pkg_mgmt_tokens(tref, metta);
Expand Down

0 comments on commit a1b2c0d

Please sign in to comment.