mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 23:48:21 +00:00
Cosmopolitan's printf-family functions currently very poorly handle being passed a long double infinity. For instance, a program such as: ```cpp #include <stdio.h> int main() { printf("%f\n", 1.0 / 0.0); printf("%Lf\n", 1.0L / 0.0L); printf("%e\n", 1.0 / 0.0); printf("%Le\n", 1.0L / 0.0L); printf("%g\n", 1.0 / 0.0); printf("%Lg\n", 1.0L / 0.0L); } ``` will currently output the following: ``` inf 0.000000[followed by 32763 more zeros] inf N.aN0000e-32769 inf N.aNe-32769 ``` when the correct expected output would be: ``` inf inf inf inf inf inf ``` This patch fixes this, and adds tests for the behavior. |
||
---|---|---|
.. | ||
calls | ||
fmt | ||
intrin | ||
log | ||
mem | ||
nexgen32e | ||
proc | ||
runtime | ||
sock | ||
stdio | ||
str | ||
thread | ||
time | ||
tinymath | ||
x | ||
xed | ||
BUILD.mk |