LibJS: Use pow instead of __bulitin_pow on clang

__bulitin_pow doesn't seem to exist on clang, at least
it didn't build with it.
This commit is contained in:
Luke 2020-11-07 00:20:55 +00:00 committed by Andreas Kling
parent 745ffca580
commit 020b782474
Notes: sideshowbarker 2024-07-19 01:32:09 +09:00

View file

@ -30,9 +30,15 @@
#include <LibJS/Runtime/NumberObject.h>
#include <math.h>
#ifdef __clang__
# define EPSILON_VALUE pow(2, -52)
# define MAX_SAFE_INTEGER_VALUE pow(2, 53) - 1
# define MIN_SAFE_INTEGER_VALUE -(pow(2, 53) - 1)
#else
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) };
#endif
namespace JS {