#28414 [NEW]: decimals in float
| From: | udo dot steinbach at ewetel dot net | Date: | Sun, 16 May 2004 10:57:14 +0000 |
| Subject: | #28414 [NEW]: decimals in float | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969360657@lists.php.net to get a copy of this message | ||
From: udo dot steinbach at ewetel dot net
Operating system: Windows
PHP version: 4.3.6
PHP Bug Type: Documentation problem
Bug description: decimals in float
Description:
------------
My english is to bad, so in german.
In /de/language.types.float.html heißt es
> Das gründet sich auf die Tatsache, dass es unmöglich ist, manche
Dezimal-Zahlen durch eine endliche Anzahl an Nachkomma-Stellen
darzustellen
Das ist zwar richtig, aber die falsche Erklärung für den Satz davor
> So wird floor((0.1 + 0.7) * 10) normalerweise 7
Siehe news:m3wvqvu656.fsf@penguin.slac.stanford.edu
und
news:3848a517.19666898@news.btx.dtag.de
> Die Basis 10 ist inkommensurabelk mit der Basis 2. Auf binaer
arbeitenden Gleitkommahardwares wird daher (change - dollar_amount) = 1/10
auf der Hardware nicht exakt darstellbar sein, sondern so etwas wie
0.0999
sein. Damit ist int(100*...)=9.
Reproduce code:
---------------
?? for docs?
Expected result:
----------------
?? for docs?
Actual result:
--------------
?? for docs?
--
Edit bug report at http://bugs.php.net/?id=28414&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28414&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28414&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28414&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28414&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28414&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28414&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28414&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28414&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28414&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28414&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28414&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28414&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28414&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28414&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28414&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28414&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28414&r=float