php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21628 decimal numbers without decimal places
Submitted: 2003-01-14 02:41 UTC Modified: 2003-01-27 22:42 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: czapel at go2 dot pl Assigned:
Status: No Feedback Package: *Math Functions
PHP Version: 4.2.2 OS: SuSE Linux 8.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: czapel at go2 dot pl
New email:
PHP Version: OS:

 

 [2003-01-14 02:41 UTC] czapel at go2 dot 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-27 22:42 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC