You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
[-]sprintf %.17g negative infinty bug[/-][+]sprintf %.17g negative infinity bug[/+]divinity76 commentedon Sep 20, 2024
duplicate of #9209
cmb69 commentedon Sep 20, 2024
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.
cmb69 commentedon Sep 20, 2024
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.
[-]sprintf %.17g negative infinity bug[/-][+]printf() can strip sign of -INF[/+]Fix GH-15964: printf() can strip sign of -INF
Merge branch 'PHP-8.4'