Skip to content

Commit a5b2c19

Browse files
committed
feat: add std.atan2
Fixes: #141 Fixes: google/jsonnet#1118
1 parent aeb50fc commit a5b2c19

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/jrsonnet-stdlib/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {
104104
("asin", builtin_asin::INST),
105105
("acos", builtin_acos::INST),
106106
("atan", builtin_atan::INST),
107+
("atan2", builtin_atan2::INST),
107108
("exp", builtin_exp::INST),
108109
("mantissa", builtin_mantissa::INST),
109110
("exponent", builtin_exponent::INST),

crates/jrsonnet-stdlib/src/math.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ pub fn builtin_atan(x: f64) -> f64 {
8989
x.atan()
9090
}
9191

92+
#[builtin]
93+
pub fn builtin_atan2(y: f64, x: f64) -> f64 {
94+
y.atan2(x)
95+
}
96+
9297
#[builtin]
9398
pub fn builtin_exp(x: f64) -> f64 {
9499
x.exp()

0 commit comments

Comments
 (0)