|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-12 09:54 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 20:00:01 2025 UTC |
--- My code --- <? $HRDelta = 1; function HRValue($Max = 100){ global $HRDelta; $C = ($Max < 0 ? -1 : 1); $Order = floor(log10($Max * $C)); $i = 1; do{ $AxisMax = $i * $HRDelta * pow(10,$Order); $i++; }while($Max * $C >= $AxisMax); echo "Expression: (\$Max * \$C >= \$AxisMax) ? \"true\" : \"false\")<BR>\n"; echo "Evaluated: (" . $Max * $C . " >= $AxisMax) ? \"true\" : \"false\")<BR>\n"; echo "Answer: " . (($Max * $C >= $AxisMax) ? "true" : "false") . "<BR>"; return $C * $AxisMax; } echo HRValue(-0.7); ?> --- My Output --- Expression: ($Max * $C >= $AxisMax) ? "true" : "false") Evaluated: (0.7 >= 0.7) ? "true" : "false") Answer: false -0.7 --- Description problem --- The last comparison operator returns false for some unknown reason. I also checked the variables using var_dump and they seem to be exactly the same (float(0.7)) according to php. --- My configure line -- './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql=/usr/' '--with-png-dir=/usr/local/libpng' '--with-gd=/usr/local/gd-1.8.4' '--with-zlib' '--with-ttf' '--with-freetype-dir=/usr/local/freetype2' '--with-xml' '--with-oracle=/users/home/oskarsson/OraHome1' '--with-oci8=/users/home/oskarsson/OraHome1'