#19417 [NEW]: Float Operation get rounded
| From: | admin at eurologon dot com | Date: | Sun, 15 Sep 2002 15:38:23 +0000 |
| Subject: | #19417 [NEW]: Float Operation get rounded | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-19399@lists.php.net to get a copy of this message | ||
From: admin@eurologon.com
Operating system: RH7.2
PHP version: 4.2.1
PHP Bug Type: Math related
Bug description: Float Operation get rounded
All the following lines output an integer value (6) instead of a float one
(6.9):
echo 5.2+1.7;
echo (float)5.2+(float)1.7;
printf("%2.2f",(float)5.2+1.7);
echo sprintf("%2.2f",(float)5.2+1.7);
...
same thing with "*" operator:
echo (float)60*0.7;
returns 0
php 4.2.1 (ftp+gd+ctype+bcmath+zlib)
Apache 1.3.26
--
Edit bug report at http://bugs.php.net/?id=19417&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19417&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19417&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19417&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19417&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19417&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19417&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19417&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19417&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19417&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19417&r=globals