diff options
author | Mike Pall <mike> | 2013-02-22 01:44:17 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2013-02-22 01:44:17 +0100 |
commit | 19d565145592b45713adfd474224a1e46a533a99 (patch) | |
tree | bc0d9571abe59cfe2b977d2d3a13809526fb6181 /src/lib_math.c | |
parent | e20157c6e68472e7c4d82d9ed4c0bb5be029c388 (diff) | |
download | luajit-19d565145592b45713adfd474224a1e46a533a99.tar.gz luajit-19d565145592b45713adfd474224a1e46a533a99.tar.bz2 luajit-19d565145592b45713adfd474224a1e46a533a99.zip |
Replace math.deg/math.rad with builtin Lua function.
Diffstat (limited to 'src/lib_math.c')
-rw-r--r-- | src/lib_math.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib_math.c b/src/lib_math.c index b23d9a2d..e474f980 100644 --- a/src/lib_math.c +++ b/src/lib_math.c | |||
@@ -63,11 +63,8 @@ LJLIB_ASM(math_log) LJLIB_REC(math_log) | |||
63 | return FFH_RETRY; | 63 | return FFH_RETRY; |
64 | } | 64 | } |
65 | 65 | ||
66 | LJLIB_PUSH(57.29577951308232) | 66 | LJLIB_LUA(math_deg) /* function(x) return x * 57.29577951308232 end */ |
67 | LJLIB_ASM_(math_deg) LJLIB_REC(math_degrad) | 67 | LJLIB_LUA(math_rad) /* function(x) return x * 0.017453292519943295 end */ |
68 | |||
69 | LJLIB_PUSH(0.017453292519943295) | ||
70 | LJLIB_ASM_(math_rad) LJLIB_REC(math_degrad) | ||
71 | 68 | ||
72 | LJLIB_ASM(math_atan2) LJLIB_REC(.) | 69 | LJLIB_ASM(math_atan2) LJLIB_REC(.) |
73 | { | 70 | { |