-
Notifications
You must be signed in to change notification settings - Fork 7.8k
printf() can strip sign of -INF #15964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
duplicate of #9209 |
Nope, not really. That is about truncation of INF due to very low precision, but the reported issue here is about loosing the minus sign. |
Also note that the problem is not particularly related to the precision, see https://3v4l.org/3F8nm. The only case where the minus sign would properly be retained is for padding="0", e.g. printf("%06g", -INF);, but that apparently looses the "I". Having had more test cases could have helped. |
* PHP-8.4: Fix GH-15964: printf() can strip sign of -INF
Description
The following code:
Resulted in this output:
But I expected this output instead:
PHP Version
PHP 8.3.11
Operating System
Ubuntu 24.04
The text was updated successfully, but these errors were encountered: