mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibJS: Add Number constants
This commit is contained in:
committed by
Andreas Kling
parent
f85aa8462f
commit
b7032b4972
@@ -28,6 +28,7 @@
|
||||
#include <LibJS/Runtime/Error.h>
|
||||
#include <LibJS/Runtime/NumberConstructor.h>
|
||||
#include <LibJS/Runtime/NumberObject.h>
|
||||
#include <math.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
@@ -35,6 +36,12 @@ NumberConstructor::NumberConstructor()
|
||||
{
|
||||
put("prototype", interpreter().number_prototype());
|
||||
put("length", Value(1));
|
||||
put("EPSILON", Value(pow(2, -52)));
|
||||
put("MAX_SAFE_INTEGER", Value(pow(2, 53) - 1));
|
||||
put("MIN_SAFE_INTEGER", Value(-(pow(2, 53) - 1)));
|
||||
put("NEGATIVE_INFINITY", Value(-js_infinity().as_double()));
|
||||
put("POSITIVE_INFINITY", js_infinity());
|
||||
put("NaN", js_nan());
|
||||
}
|
||||
|
||||
NumberConstructor::~NumberConstructor()
|
||||
|
||||
Reference in New Issue
Block a user