mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-24 03:02:23 +00:00
LibM: Add INFINITY macro
This commit is contained in:
parent
8a94813007
commit
ead76377b0
Notes:
sideshowbarker
2024-07-19 05:50:35 +09:00
Author: https://github.com/linusg
Commit: ead76377b0
Pull-request: https://github.com/SerenityOS/serenity/pull/2496
3 changed files with 7 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue