Re: floored by floor()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



å 2010-10-13äç 22:48 -0700ïMattias Thorslundåéï
> Hi List,
> 
> I'm having a problem with the behavior of the floor() function:
> 
> echo floor(327.03 * 100)."\n"; //prints "32702" and not "32703"!!
> 
> Sanity check:
> var_dump(327.03 * 100); //prints "float(32703)" as expected
> 
> Any ideas why this happens, and how to work around it?
> 
> Thanks,
> 
> Mattias
> 
> 

i think u should read the manual about int and float:

http://www.php.net/manual/en/language.types.integer.php

http://www.php.net/manual/en/language.types.float.php#warn.float-precision


jim



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux