mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 10:41:30 +00:00
LibJS: Implement Infinity
This commit is contained in:
parent
40b3203941
commit
543c6e00db
Notes:
sideshowbarker
2024-07-19 07:59:06 +09:00
Author: https://github.com/linusg
Commit: 543c6e00db
Pull-request: https://github.com/SerenityOS/serenity/pull/1584
5 changed files with 40 additions and 0 deletions
|
@ -54,6 +54,7 @@ public:
|
|||
bool is_array() const;
|
||||
|
||||
bool is_nan() const { return is_number() && __builtin_isnan(as_double()); }
|
||||
bool is_infinity() const { return is_number() && __builtin_isinf(as_double()); }
|
||||
|
||||
Value()
|
||||
: m_type(Type::Undefined)
|
||||
|
@ -173,6 +174,11 @@ inline Value js_nan()
|
|||
return Value(__builtin_nan(""));
|
||||
}
|
||||
|
||||
inline Value js_infinity()
|
||||
{
|
||||
return Value(__builtin_huge_val());
|
||||
}
|
||||
|
||||
Value greater_than(Value lhs, Value rhs);
|
||||
Value greater_than_equals(Value lhs, Value rhs);
|
||||
Value less_than(Value lhs, Value rhs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue