Add math.atan2 (#819)

This commit is contained in:
Artem Yarmoliuk
2024-11-18 22:11:19 +00:00
committed by GitHub
parent b93cb9b322
commit cc579f8fd6
4 changed files with 54 additions and 0 deletions

View File

@@ -299,6 +299,28 @@ public final class MathNodes {
}
}
public abstract static class atan2 extends ExternalMethod2Node {
@Specialization
protected double eval(VmTyped self, long x, long y) {
return StrictMath.atan2(x, y);
}
@Specialization
protected double eval(VmTyped self, long x, double y) {
return StrictMath.atan2(x, y);
}
@Specialization
protected double eval(VmTyped self, double x, double y) {
return StrictMath.atan2(x, y);
}
@Specialization
protected double eval(VmTyped self, double x, long y) {
return StrictMath.atan2(x, y);
}
}
public abstract static class gcd extends ExternalMethod2Node {
@TruffleBoundary
@Specialization