feat: add Math library with abs, ceil, floor, trig, and xorshift RNG
Implement a new optional Math module for the Wren standard library, gated behind the WREN_USE_LIB_MATH flag (default on). The module provides double-precision math functions (abs, ceil, floor, int, frac, sin, cos, tan, deg, rad) and a xorshift-based pseudo-random number generator with srand/rand methods. Includes comprehensive test files for each function and an all_tests runner.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
IO.print(Math.floor(2.3)) // expect: 2
|
||||
IO.print(Math.floor(3.8)) // expect: 3
|
||||
IO.print(Math.floor(-2.3)) // expect: -3
|
||||
IO.print(Math.floor(-3.8)) // expect: -4
|
||||
Reference in New Issue
Block a user