The calculation used to be wrong when exactly at a power of 2. `nearest_shift` always return the "next" power of 2 `nearest_shift(4) == 3 # 2^3 = 8`. On the other hand `next_power_of_2` returns the exact value if that value is a power of 2 (i.e. `next_power_of_2(4) == 4`). I.e. : ``` WARN_PRINT(itos(next_power_of_2(4)) + " " + itos(1 << nearest_shift(4))); // WARNING: ... : 4 8 ``` Is this by design?
Name |
Last commit
|
Last update |
---|---|---|
.github | Loading commit data... | |
core | Loading commit data... | |
doc | Loading commit data... | |
drivers | Loading commit data... | |
editor | Loading commit data... | |
main | Loading commit data... | |
misc | Loading commit data... | |
modules | Loading commit data... | |
platform | Loading commit data... | |
scene | Loading commit data... | |
servers | Loading commit data... | |
thirdparty | Loading commit data... | |
.appveyor.yml | Loading commit data... | |
.clang-format | Loading commit data... | |
.editorconfig | Loading commit data... | |
.gitattributes | Loading commit data... | |
.gitignore | Loading commit data... | |
.mailmap | Loading commit data... | |
.travis.yml | Loading commit data... | |
AUTHORS.md | Loading commit data... | |
CHANGELOG.md | Loading commit data... | |
CONTRIBUTING.md | Loading commit data... | |
COPYRIGHT.txt | Loading commit data... | |
DONORS.md | Loading commit data... | |
LICENSE.txt | Loading commit data... | |
LOGO_LICENSE.md | Loading commit data... | |
README.md | Loading commit data... | |
SConstruct | Loading commit data... | |
compat.py | Loading commit data... | |
gles_builders.py | Loading commit data... | |
icon.png | Loading commit data... | |
icon.svg | Loading commit data... | |
logo.png | Loading commit data... | |
logo.svg | Loading commit data... | |
methods.py | Loading commit data... | |
platform_methods.py | Loading commit data... | |
version.py | Loading commit data... |