Skip to content

Commit

Permalink
feat: add std.atan2
Browse files Browse the repository at this point in the history
  • Loading branch information
CertainLach committed Nov 30, 2023
1 parent aeb50fc commit a5b2c19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/jrsonnet-stdlib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {
("asin", builtin_asin::INST),
("acos", builtin_acos::INST),
("atan", builtin_atan::INST),
("atan2", builtin_atan2::INST),
("exp", builtin_exp::INST),
("mantissa", builtin_mantissa::INST),
("exponent", builtin_exponent::INST),
Expand Down
5 changes: 5 additions & 0 deletions crates/jrsonnet-stdlib/src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ pub fn builtin_atan(x: f64) -> f64 {
x.atan()
}

#[builtin]
pub fn builtin_atan2(y: f64, x: f64) -> f64 {
y.atan2(x)
}

#[builtin]
pub fn builtin_exp(x: f64) -> f64 {
x.exp()
Expand Down

0 comments on commit a5b2c19

Please sign in to comment.