Retoor software development Projects Research SearchXNG
Register Sign In

5 lines
172 B
Plaintext
Raw Normal View History

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.
2015-01-22 16:41:19 +01:00
IO.print(Math.frac(8)) // expect: 0
IO.print(Math.frac(12.34)) // expect: 0.34
IO.print(Math.frac(-8)) // expect: -0
IO.print(Math.frac(-12.34)) // expect: -0.34
Reference in New Issue Copy Permalink
a34eb52d6c
wren/test/math/frac.wren
Response time: 34ms
Mail Licenses API