#38746 [NEW]: number_format() returns 'inf' for too large numbers
| From: | carlsagan43 at antidom dot com | Date: | Fri, 08 Sep 2006 00:26:14 +0000 |
| Subject: | #38746 [NEW]: number_format() returns 'inf' for too large numbers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-101855@lists.php.net to get a copy of this message | ||
From: carlsagan43 at antidom dot com
Operating system: Windows XP
PHP version: 5.1.6
PHP Bug Type: Math related
Bug description: number_format() returns 'inf' for too large numbers
Description:
------------
This isnt directly something wrong, but it does need to be addressed:
When working with large numbers in BCmath, the need to output the number
comes about. When trying to use the function number_format(), it returns
'inf'. This function should be changed to also accept strings that are
composed or digits.
Reproduce code:
---------------
<?php
echo number_format(bcpow('1000', '1000'));
?>
Expected result:
----------------
10000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000
(with commas)
Actual result:
--------------
inf
--
Edit bug report at http://bugs.php.net/?id=38746&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38746&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38746&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38746&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38746&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38746&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38746&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38746&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38746&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38746&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38746&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38746&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38746&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38746&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38746&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38746&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38746&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38746&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38746&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38746&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38746&r=mysqlcfg