Does anyone know why range(-8.00, 8.00, 0.05) seems fail?
Array
(
[0] => -8
[1] => -7.95
[2] => -7.9
[3] => -7.85
[4] => -7.8
[5] => -7.75
That's a known problem, hopefully already fixed. See bug #54459.
Basically now instead of making consecutive floating point additions, the range
function now increments an integer and multiplies it by the step.
Basically, you know have:
-8.00, -8.00 + 1 * 0.05, -8.00 + 2 * 0.05, ...
instead of
-8.00, -8.00 + 0.05, -8.00 + 0.05 + 0.05, ...
You can see this makes a difference:
$ php
while:
$ php -r 'echo sprintf("%.17f", .1*100);'
10.00000000000000000