#43746 [NEW]: unexpected result in round()

From: Date: Fri, 04 Jan 2008 05:46:18 +0000
Subject: #43746 [NEW]: unexpected result in round()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121020@lists.php.net to get a copy of this message
From:             phil at phymoky dot com
Operating system: Windows 2000
PHP version:      5.2.5
PHP Bug Type:     Math related
Bug description:  unexpected result in round()

Description:
------------
unexpected result in round()

Reproduce code:
---------------
<?php
echo round(1234567, -5); // is 1.2E+6
echo round(1334567, -5); // is 1300000
echo round(1134567, -5); // is 1100000
?>

Expected result:
----------------
1200000
1300000
1100000


-- 
Edit bug report at http://bugs.php.net/?id=43746&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43746&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43746&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43746&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43746&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43746&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=43746&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43746&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43746&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43746&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43746&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43746&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=43746&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=43746&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43746&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43746&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43746&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43746&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43746&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43746&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43746&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43746&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#121020) next »