summaryrefslogtreecommitdiffstats
path: root/core/math/random_pcg.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #27193 from toasteater/fix/pcg-randfRémi Verschelde2019-06-121-6/+2
|\ | | | | Improved uniformity of RandomPCG::randf.
| * Improved uniformity of RandomPCG::randf.toasteater2019-03-191-6/+2
| | | | | | | | | | | | | | | | | | | | When generating single precision floats, Godot casts a uint32_t to float, causing uniformity loss. This new randf, inspired by T. R. Campbell's random_real, samples the output of rand as the fraction part of an infinite binary number, with some tricks to reduce ops and branching. This method provides "good enough" uniformity at decent speed, for floats greater than 2^-64. Smaller numbers are floored to 0.
* | Properly setup seed in RNGChaosus2019-03-271-2/+1
|/
* Fix -Wc++11-extensions warning after #26737Rémi Verschelde2019-03-071-1/+2
| | | | Fixes #26769.
* Fixed get_seed() not returning the correct seed.MidZik2019-03-071-7/+7
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Implement random number generatorChaosus2018-11-131-0/+55
Co-authored-by: Zirak <zirakertan@gmail.com>