mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-22 17:12:55 +08:00
13 lines
412 B
Python
13 lines
412 B
Python
|
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')
|