1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +00:00

LibJS: constexpr some Number object constant values

This commit is contained in:
Linus Groh 2020-10-16 14:28:17 +02:00 committed by Andreas Kling
parent 4c759ff751
commit b98b83712f

View file

@ -30,10 +30,9 @@
#include <LibJS/Runtime/NumberObject.h>
#include <math.h>
// FIXME: constexpr these?
#define EPSILON_VALUE pow(2, -52)
#define MAX_SAFE_INTEGER_VALUE pow(2, 53) - 1
#define MIN_SAFE_INTEGER_VALUE -(pow(2, 53) - 1)
constexpr const double EPSILON_VALUE { __builtin_pow(2, -52) };
constexpr const double MAX_SAFE_INTEGER_VALUE { __builtin_pow(2, 53) - 1 };
constexpr const double MIN_SAFE_INTEGER_VALUE { -(__builtin_pow(2, 53) - 1) };
namespace JS {