mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-25 07:19:02 +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. |
||
---|---|---|
.. | ||
ctl | ||
dsp | ||
libc | ||
libcxx | ||
math | ||
net | ||
posix | ||
tool | ||
BUILD.mk |