#44084 [Opn->Bgs]: dividing problem

From: Date: Sat, 09 Feb 2008 15:58:31 +0000
Subject: #44084 [Opn->Bgs]: dividing problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122117@lists.php.net to get a copy of this message
ID: 44084 Updated by: helly@php.net Reported By: hosting at indiannic dot com -Status: Open +Status: Bogus Bug Type: Math related Operating System: windows 2000 PHP Version: 5.2.5 New Comment: [marcus@zaphod PHP_5_3]$ php -r 'var_dump(46985.532 / 3600 );' make: `sapi/cli/php' is up to date. float(13.051536666667) [marcus@zaphod PHP_5_3]$ php -r '$t=46985.532/3600; var_dump($t);' make: `sapi/cli/php' is up to date. float(13.051536666667) [marcus@zaphod PHP_5_3]$ php -r '$t=46985.532/3600; echo($t);' make: `sapi/cli/php' is up to date. 13.051536666667[marcus@zaphod PHP_5_3]$ Same for 5.2 Previous Comments: ------------------------------------------------------------------------ [2008-02-09 15:56:57] hosting at indiannic dot com a few links below we have php 5 and php 4 both on the same server windows 2000 with iis 5 this is on php 5.2.5 http://maptelltrack.com/divide.php this gives correct Wrong answer this is on php 4.3.10 http://maptell.com/divide.php this gives correct answer ------------------------------------------------------------------------ [2008-02-09 14:58:03] hosting at indiannic dot com Description: ------------ dividing a float value with another gives result as 10 always Reproduce code: --------------- <?php $test = 46985.532 / 3600 ; echo($test); ?> Expected result: ---------------- 13.0515 Actual result: -------------- 10 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44084&edit=1

« previous php.bugs (#122117) next »