Skip to content

Commit 6b0e5d3

Browse files
committed
[lua] Remove 2nd atan argument for lua 5.1/5.2/jit
1 parent 95bba1c commit 6b0e5d3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

std/lua/Math.hx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,23 @@ extern class Math {
6464
**/
6565
static function asin(x:Float):Float;
6666

67+
#if (lua_ver <= 5.2 || luajit)
6768
/**
6869
Returns the arc tangent of y/x (in radians), using the signs of both arguments to find the quadrant of the result. It also handles correctly the case of x being zero.
6970
7071
The default value for x is 1, so that the call math.atan(y) returns the arc tangent of y.
72+
**/
73+
static function atan(y:Float):Float;
74+
#else
75+
/**
76+
Returns the arc tangent of y/x (in radians), using the signs of both arguments to find the quadrant of the result. It also handles correctly the case of x being zero.
7177
72-
The x argument is ignored on lua 5.2 or older, where atan2 was used instead.
78+
The default value for x is 1, so that the call math.atan(y) returns the arc tangent of y.
79+
80+
The x argument is ignored on lua 5.2 or older and luajit, where atan2 is available instead.
7381
**/
7482
static function atan(y:Float, ?x:Float):Float;
83+
#end
7584

7685
#if !(lua_ver >= 5.5)
7786
/**

0 commit comments

Comments
 (0)