diff options
author | Mike Pall <mike> | 2013-08-17 00:50:53 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2013-08-17 00:50:53 +0200 |
commit | fd1a8ddb3ce5f22724b411c4dbc2550bd8776eba (patch) | |
tree | a4b3fab47efd9da268de958d608cd48c6b21bbde | |
parent | 362260b24a7d6f73a2dfe36964441898ebaae8bc (diff) | |
download | luajit-fd1a8ddb3ce5f22724b411c4dbc2550bd8776eba.tar.gz luajit-fd1a8ddb3ce5f22724b411c4dbc2550bd8776eba.tar.bz2 luajit-fd1a8ddb3ce5f22724b411c4dbc2550bd8776eba.zip |
Fix argument checks for math.deg()/math.rad().
-rw-r--r-- | src/lib_math.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib_math.c b/src/lib_math.c index b23d9a2d..19e433fc 100644 --- a/src/lib_math.c +++ b/src/lib_math.c | |||
@@ -47,6 +47,12 @@ LJLIB_ASM_(math_tanh) LJLIB_REC(math_htrig IRCALL_tanh) | |||
47 | LJLIB_ASM_(math_frexp) | 47 | LJLIB_ASM_(math_frexp) |
48 | LJLIB_ASM_(math_modf) LJLIB_REC(.) | 48 | LJLIB_ASM_(math_modf) LJLIB_REC(.) |
49 | 49 | ||
50 | LJLIB_PUSH(57.29577951308232) | ||
51 | LJLIB_ASM_(math_deg) LJLIB_REC(math_degrad) | ||
52 | |||
53 | LJLIB_PUSH(0.017453292519943295) | ||
54 | LJLIB_ASM_(math_rad) LJLIB_REC(math_degrad) | ||
55 | |||
50 | LJLIB_ASM(math_log) LJLIB_REC(math_log) | 56 | LJLIB_ASM(math_log) LJLIB_REC(math_log) |
51 | { | 57 | { |
52 | double x = lj_lib_checknum(L, 1); | 58 | double x = lj_lib_checknum(L, 1); |
@@ -63,12 +69,6 @@ LJLIB_ASM(math_log) LJLIB_REC(math_log) | |||
63 | return FFH_RETRY; | 69 | return FFH_RETRY; |
64 | } | 70 | } |
65 | 71 | ||
66 | LJLIB_PUSH(57.29577951308232) | ||
67 | LJLIB_ASM_(math_deg) LJLIB_REC(math_degrad) | ||
68 | |||
69 | LJLIB_PUSH(0.017453292519943295) | ||
70 | LJLIB_ASM_(math_rad) LJLIB_REC(math_degrad) | ||
71 | |||
72 | LJLIB_ASM(math_atan2) LJLIB_REC(.) | 72 | LJLIB_ASM(math_atan2) LJLIB_REC(.) |
73 | { | 73 | { |
74 | lj_lib_checknum(L, 1); | 74 | lj_lib_checknum(L, 1); |