Bug #52894 [NEW]: number_format fails with large values

From: Date: Mon, 20 Sep 2010 15:53:57 +0000
Subject: Bug #52894 [NEW]: number_format fails with large values
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-154515@lists.php.net to get a copy of this message
From:             
Operating system: linux
PHP version:      5.2.14
Package:          *Math Functions
Bug Type:         Bug
Bug description:number_format fails with large values

Description:
------------
wrong output, not as give, drifts a lot!


Test script:
---------------
number_format("1234.560000", 50, '.', '');




Expected result:
----------------
expected output should be 1234.56 with additional 48 zeros! and not a
'random value'.


Actual result:
--------------
== 1234.55999999999994543031789362430572509765625000000000

????
can't be!


-- 
Edit bug report at http://bugs.php.net/bug.php?id=52894&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=52894&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=52894&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=52894&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=52894&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52894&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=52894&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=52894&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=52894&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=52894&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=52894&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=52894&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=52894&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=52894&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=52894&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52894&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52894&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=52894&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=52894&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=52894&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=52894&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=52894&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#154515) next »