[php-src] Issue #20165: php comparison error (because float internal binary representation?)
| From: | Nolwennig-Jeulin | Date: | Tue, 14 Oct 2025 10:53:53 +0000 |
| Subject: | [php-src] Issue #20165: php comparison error (because float internal binary representation?) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251057@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20165
Author: Nolwennig-Jeulin
From manual page: https://php.net/language.operators.comparison
---
curious behavior for
```
$strWith14Decimals = '499.99999999999999';
$strWith13Decimals = '499.9999999999999';
echo ($strWith14Decimals < 500) ? 'inf' : 'sup'; // return 'sup'
(unexpected)
echo ($strWith13Decimals < 500) ? 'inf' : 'sup'; // return 'inf'
(as expected)
```