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:
Marco Lizza
2015-01-22 15:41:19 +00:00
parent a4baa42d6f
commit 9a50b5f318
10 changed files with 206 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
IO.print(Math.int(8)) // expect: 8
IO.print(Math.int(12.34)) // expect: 12
IO.print(Math.int(-8)) // expect: -8
IO.print(Math.int(-12.34)) // expect: -12