1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +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

@ -76,8 +76,8 @@ public:
bool is_infinity() const { return is_number() && __builtin_isinf(as_double()); }
bool is_positive_infinity() const { return is_number() && __builtin_isinf_sign(as_double()) > 0; }
bool is_negative_infinity() const { return is_number() && __builtin_isinf_sign(as_double()) < 0; }
bool is_positive_zero() const { return is_number() && 1.0 / as_double() == __builtin_huge_val(); }
bool is_negative_zero() const { return is_number() && 1.0 / as_double() == -__builtin_huge_val(); }
bool is_positive_zero() const { return is_number() && 1.0 / as_double() == INFINITY; }
bool is_negative_zero() const { return is_number() && 1.0 / as_double() == -INFINITY; }
bool is_integer() const { return is_finite_number() && (i32)as_double() == as_double(); }
bool is_finite_number() const
{
@ -257,12 +257,12 @@ inline Value js_nan()
inline Value js_infinity()
{
return Value(__builtin_huge_val());
return Value(INFINITY);
}
inline Value js_negative_infinity()
{
return Value(-__builtin_huge_val());
return Value(-INFINITY);
}
Value greater_than(Interpreter&, Value lhs, Value rhs);