|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-06 20:31 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 06:00:01 2025 UTC |
Description: ------------ The range function works on some float values but not others. Reproduce code: --------------- WORKS: print_r(range(0.3, 0.4, 0.1)); FAILS: print_r(range(5.5, 5.6, 0.1)); WORKS: print_r(range(5.5, 5.7, 0.1)); Expected result: ---------------- Array ( [0] => 0.3 [1] => 0.4 ) Array ( [0] => 5.5 [1] => 5.6 ) Array ( [0] => 5.5 [1] => 5.6 [2] => 5.7 ) Actual result: -------------- Array ( [0] => 0.3 [1] => 0.4 ) PHP Warning: range(): step exceeds the specified range Array ( [0] => 5.5 [1] => 5.6 [2] => 5.7 )