13 lines
412 B
Python
Raw Normal View History

2023-05-14 13:02:50 +08:00
import pika_lua
lua_math = pika_lua.require("math")
assert lua_math.pi == 3.141592653589793
assert lua_math.sin(0) == 0
assert lua_math.sin(lua_math.pi / 2) == 1
assert lua_math.sin(lua_math.pi) == 0
assert lua_math.sin(lua_math.pi * 3 / 2) == -1
assert lua_math.sin(lua_math.pi * 2) == 0
assert lua_math.cos(0) == 1
assert lua_math.cos(lua_math.pi / 2) == 0
assert lua_math.cos(lua_math.pi) == -1
print('PASS')