ID:               15026
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Duplicate
 Bug Type:         BC math related
 Operating System: WIN NT 4.0 SP6
 PHP Version:      4.1.1
 New Comment:

Dupe of 13551: PHP's BCmath implementation doesn't support decimal
numbers.


Previous Comments:
------------------------------------------------------------------------

[2002-01-14 02:38:51] [EMAIL PROTECTED]

Source code for demonstration:
<?
$a ="0.23568";
$b ="0.45689";
$c ="0.45689";
echo $a."...............a<BR>";
echo $b."...............b<BR>";
echo $c."...............b<BR>";
echo bccomp ($b, $c, 40)."...............bccomp($a, $c , 40)<BR>";
echo bcdiv ($a, $b , 40)."................bcdiv($a, $b , 40)<BR>";
echo bcmul ($a, $b , 40)."................bcmul($a, $b , 40)<BR>";
echo bcpow ($a, $b , 40)."................bcpow($a, $b , 40)<BR>";
echo pow ($a, $b )."................pow($a, $b )<BR>";
echo bcadd ($a, $b , 40)."................bcadd($a, $b , 40)<BR>";
echo bcsub ($a, $b , 40)."................bcsub($a, $b , 40)<BR>";
echo bcsqrt ($a, 40)."................bcsqrt($a, $b , 40)<BR>";

?>
Result:
0.23568...............a
0.45689...............b
0.45689...............b
0...............bccomp(0.23568, 0.45689 , 40)
0.5158353214121560988421720764297752194182................bcdiv(0.23568,
0.45689 , 40)
0.1076798352................bcmul(0.23568, 0.45689 , 40)
********* See here *****************************
1................bcpow(0.23568, 0.45689 , 40)
0.5166786686981................pow(0.23568, 0.45689 )
********* End of error *************************
0.6925700000000000000000000000000000000000................bcadd(0.23568,
0.45689 , 40)
-0.2212100000000000000000000000000000000000................bcsub(0.23568,
0.45689 , 40)
0.4854688455503607288095934026252222080687................bcsqrt(0.23568,
0.45689 , 40)

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=15026&edit=1

Reply via email to