From:             rudolphi at chemie dot uni-kl dot de
Operating system: Ubuntu 8.04 (32bit)
PHP version:      5.2.6
PHP Bug Type:     Variables related
Bug description:  strval gives :.0E-7 for 1e-6

Description:
------------
When converting a number in exponential format with negative exponent of
n=6,7,... strval (or implicit conversion to string) gives :.0E-(n+1) if
there is no fractional part present. The error can be found both in the
precompiled PHP 5.2.4 and self-compiled 5.2.6, but it cannot be reproduced
under Windows or under PHP 5.2.3 Ubuntu 7.10 (64bit). Seems to be closely
related to OS (?).

Reproduce code:
---------------
$float=1e-6;
echo strval($float);

Expected result:
----------------
1e-6 or 1.0e-6

Actual result:
--------------
:.0E-7

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

Reply via email to