summaryrefslogtreecommitdiff
path: root/Libraries/LibJS
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-06-04 13:05:27 +0100
committerAndreas Kling <kling@serenityos.org>2020-06-04 15:45:11 +0200
commitead76377b025eb69b9918f6b71c1539c3e233f40 (patch)
treea602bae4cf7b61fc570be5c289a698c9c716d5bd /Libraries/LibJS
parent8a94813007ecf009a4ffa4e9851211f7b0d03fec (diff)
downloadserenity-ead76377b025eb69b9918f6b71c1539c3e233f40.zip
LibM: Add INFINITY macro
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r--Libraries/LibJS/Runtime/Value.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Libraries/LibJS/Runtime/Value.h b/Libraries/LibJS/Runtime/Value.h
index 4fc78516f0..cb3e1c5835 100644
--- a/Libraries/LibJS/Runtime/Value.h
+++ b/Libraries/LibJS/Runtime/Value.h
@@ -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);