Re: [DISCUSSION] Adding the "is_integer_safe()" function
| From: | Tim Düsterhus | Date: | Mon, 28 Jul 2025 09:30:19 +0000 |
| Subject: | Re: [DISCUSSION] Adding the "is_integer_safe()" function | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128247@lists.php.net to get a copy of this message | ||
Hi
Am 2025-07-26 15:45, schrieb Rowan Tommins [IMSoP]:
can_lossless_cast<float>(2 ** 54) === falseThat one is incorrect, 2**54 *can* be exactly represented as a
float. The magic 2**53 boundary just means that the difference between consecutive representable values becomes larger than 1.
See: https://float.exposed/0x4350000000000000 and try incrementing or decrementing the "Raw Decimal Integer Value".
Best regards
Tim Düsterhus