1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:35:07 +00:00

LibM: Add INFINITY macro

This commit is contained in:
Linus Groh 2020-06-04 13:05:27 +01:00 committed by Andreas Kling
parent 8a94813007
commit ead76377b0
3 changed files with 7 additions and 6 deletions

View file

@ -213,7 +213,7 @@ double log(double x)
if (x < 0)
return NAN;
if (x == 0)
return -__builtin_huge_val();
return -INFINITY;
double y = 1 + 2 * (x - 1) / (x + 1);
double exponentiated = exp(y);
y = y + 2 * (x - exponentiated) / (x + exponentiated);
@ -257,7 +257,7 @@ double exp(double exponent)
if (integer_part & 32)
result *= e_to_power<32>();
if (integer_part >= 64)
return __builtin_huge_val();
return INFINITY;
}
exponent -= integer_part;
} else if (exponent < 0)