1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibM: Add NAN macro

This commit is contained in:
Linus Groh 2020-06-04 13:03:15 +01:00 committed by Andreas Kling
parent d315281d56
commit 8a94813007
3 changed files with 5 additions and 3 deletions

View file

@ -211,7 +211,7 @@ double log10(double x)
double log(double x)
{
if (x < 0)
return __builtin_nan("");
return NAN;
if (x == 0)
return -__builtin_huge_val();
double y = 1 + 2 * (x - 1) / (x + 1);
@ -321,7 +321,7 @@ double atan(double x)
double asin(double x)
{
if (x > 1 || x < -1)
return __builtin_nan("");
return NAN;
if (x > 0.5 || x < -0.5)
return 2 * atan(x / (1 + sqrt(1 - x * x)));
double squared = x * x;