note 128952 added to language.types.float
| From: | antduz at gmail dot com | Date: | Fri, 13 Oct 2023 11:56:25 +0000 |
| Subject: | note 128952 added to language.types.float | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220911@lists.php.net to get a copy of this message | ||
php -r 'echo 4.60*100, " ", (int)(4.60*100), PHP_EOL;'
Surprisingly (to me) it prints this:
460 459
I'd think that the string representation at least should show the '99..99' or
'00...01' part, but for unknown reason string representations don't exhibit the same
loss of precision as integers.
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 91.90.180.11)
----
Manual Page -- https://php.net/manual/en/language.types.float.php
Edit -- https://main.php.net/note/edit/128952
Del: integrated -- https://main.php.net/note/delete/128952/integrated
Del: useless -- https://main.php.net/note/delete/128952/useless
Del: bad code -- https://main.php.net/note/delete/128952/bad+code
Del: spam -- https://main.php.net/note/delete/128952/spam
Del: non-english -- https://main.php.net/note/delete/128952/non-english
Del: in docs -- https://main.php.net/note/delete/128952/in+docs
Del: other reasons-- https://main.php.net/note/delete/128952
Reject -- https://main.php.net/note/reject/128952
Search -- https://main.php.net/manage/user-notes.php