The method performs math operations using floating point precision. Floating point precision is very imprecise.
assert 16777216.0f + 1.0f == 16777216.0f; // This will not trigger an error!
Consider using double
math instead.
assert 16777216.0 + 1.0 == 16777217.0;