Home  |  Linux  | Mysql  | PHP  | XML
From:Chris W Date:Sat May 10 22:33:36 2008
Subject:Re: Division [maybe a bug]
jo opp wrote:
> Hello!
> 
> $var1= 2155243640%31104000;
> $var2= 2147309244%31104000;
> 
> echo $var1 // Return -24651656
> echo $var2 // Return 1133244
> 
> $var2 return the correct result, but $var1 is wrong (the correct
> result is 9067640)

Probably because the maximum signed 32 bit integer value is
2,147,483,648

if you are dealing with numbers that large, consider using some 
arbitrary precision math functions that can work with as large of 
numbers as you need.


http://us3.php.net/manual/en/refs.mathcrypto.math.php



-- 
Chris W
KE5GIX

"Protect your digital freedom and privacy, eliminate DRM,
learn more at http://www.defectivebydesign.org/what_is_drm"

Ham Radio Repeater Database.
http://hrrdb.com
Navigate in group php.general at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants