note 85392 deleted from function.intval by cmb
| From: | cmb@php.net | Date: | Sun, 16 Feb 2020 13:53:45 +0000 |
| Subject: | note 85392 deleted from function.intval by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-214156@lists.php.net to get a copy of this message | ||
Note Submitter: Seally
----
Re: nobodyisperfect88 at hotmail dot de
jay at w3prodigy dot com had it right. I believe it is an issue with the floating point registers on
computers, which have a precision of about 17 digits. When you get more precise than that, it
rounds.
Since the second example can fit in the register, no rounding occurs, and PHP can truncate the
portion after the decimal. However, the system automatically rounds the first example to 1, which is
what PHP returns.
(Tested on Windows XP 32bit)