Re: [DISCUSSION] Adding the "is_integer_safe()" function
| From: | Tim Düsterhus | Date: | Mon, 28 Jul 2025 13:35:10 +0000 |
| Subject: | Re: [DISCUSSION] Adding the "is_integer_safe()" function | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128260@lists.php.net to get a copy of this message | ||
Hi
Am 2025-07-28 15:00, schrieb Alexandre Daubois:
Similarly to my other email: This is false. 2**53 is exactly representable as float. Every power of two (<= 1024) is.is_representable_as_float(2**53); // false, precision loss whencasted to float
is_representable_as_float("1e308"); // trueThis is false. 1e308 is not exactly representable. The nearest representable value is 1.00000000000000001098e+308: https://float.exposed/0x7fe1ccf385ebc8a0 Best regards Tim Düsterhus