Retoor software development Projects Research SearchXNG
Register Sign In

5 lines
158 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.ceil(2.3)) // expect: 3
IO.print(Math.ceil(3.8)) // expect: 4
IO.print(Math.ceil(-2.3)) // expect: -2
IO.print(Math.ceil(-3.8)) // expect: -3
Reference in New Issue Copy Permalink
a34eb52d6c
wren/test/math/ceil.wren
Response time: 34ms
Mail Licenses API