Retoor software development Projects Research SearchXNG
Register Sign In

5 lines
162 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.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 Copy Permalink
a34eb52d6c
wren/test/math/floor.wren
Response time: 24ms
Mail Licenses API