Retoor software development Projects Research SearchXNG
Register Sign In

5 lines
72 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
Math.srand
for (i in 1..10) {
IO.print(Math.floor(Math.rand * 100))
}
Reference in New Issue Copy Permalink
a34eb52d6c
wren/test/math/rand.wren
Response time: 33ms
Mail Licenses API