#21628 [Opn->Fbk]: decimal numbers without decimal places
| From: | nicos@php.net | Date: | Tue, 14 Jan 2003 09:42:46 +0000 |
| Subject: | #21628 [Opn->Fbk]: decimal numbers without decimal places | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-29979@lists.php.net to get a copy of this message | ||
ID: 21628
Updated by: nicos@php.net
Reported By: czapel@go2.pl
-Status: Open
+Status: Feedback
Bug Type: *Math Functions
Operating System: SuSE Linux 8.0
PHP Version: 4.2.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2003-01-14 02:41:32] czapel@go2.pl
I have some unexplicable problem, when I try to perform any
mathematical
operation. This is my example script:
<?
echo microtime()."<br>";
$a=1.121212;
$b=2.999999;
echo gettype($a)."<br>";
echo gettype($b)."<br>";
echo bcmul($a,bcmul($b,$b,10),10)."<br>";
$c=$a*$b*$b;
echo $c;
?>
To make sure that browser doesn't read from cache I put microtime. The
problem is that sometimes as a result I get number with decimal places
(and
this is ok), but sometimes I get just integers as a result, in this
case it
is 4. Maybe somebody has already heart about that. I have no idea, how
should I lose this problem. Please, help me.
Regards
Michal
Configuration I use:
PHP 4.2.2
SuSE Linux
Apache 1.3.12
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21628&edit=1