ruben wrote:
Hi:
Why is the "floor" function returning 27564 instead of 27565 in this
script? PHP version is 4.2.2.
Thanks!
Ruben.
#!/usr/bin/php -q
$b = 275.65 * 100;
$b = (int)$b;
/*
$b was a floating point number with value something like 27564.989,
when displayed it shows correctly
- Original Message -
From: "ruben" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 17, 2003 1:52 PM
Subject: [PHP] Unexpected result in floor function
> Hi:
>
> Why is the "floor" function returning 27564 instead of 27565 in this
&
Hi:
Why is the "floor" function returning 27564 instead of 27565 in this
script? PHP version is 4.2.2.
Thanks!
Ruben.
#!/usr/bin/php -q
$b = 275.65 * 100;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b);// Incorrect. why 27564?
$b = 27565;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($
3 matches
Mail list logo