|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-31 19:10 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
Description: ------------ Using PHP 5.0.1 as a CGI script. 10 * '.25' should be 2.5 but it equates to 0. 10 * floatval('.25') does equal 2.5. Does not occur in PHP 5.0.0RC2. May be a related to Bug # 29547. Reproduce code: --------------- $a = '.25'; $b = '0.25'; echo "10 * .25 == ".(10*$a)."\n"; echo "10 * 0.25 == ".(10*$b)."\n"; Expected result: ---------------- 10 * .25 == 2.5 10 * 0.25 == 2.5 Actual result: -------------- 10 * .25 == 0 10 * 0.25 == 2.5