mirror of
https://github.com/minetest/minetest_docs.git
synced 2024-11-19 22:13:52 +01:00
Add warning concerning math.random
portability
This commit is contained in:
parent
cf4192e8ac
commit
8abac46fe3
@ -58,6 +58,11 @@ make sure that both the upper & lower bound
|
||||
as well as their difference are within the C `int` range -
|
||||
otherwise you may get overflows & errors.
|
||||
|
||||
WARNING: This is not portable; different builds on different platforms will produce different random numbers.
|
||||
PUC Lua 5.1 builds use a system-provided random generator.
|
||||
LuaJIT builds use LuaJIT's PRNG implementation.
|
||||
Do not use `math.random` in mapgen, for example.
|
||||
|
||||
TIP: Use `math.random` as your go-to versatile "non-deterministic" random source.
|
||||
|
||||
== Random Number Generators
|
||||
|
Loading…
Reference in New Issue
Block a user