Skip to content

Commit cccf9e3

Browse files
committed
refactor(builtins): use std::numbers instead of <cmath> for M_PI and HUGE_VAL (float inf)
1 parent 6d270fc commit cccf9e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/arkreactor/Builtins/Builtins.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#define _USE_MATH_DEFINES
2-
#include <cmath>
31
#include <limits>
2+
#include <numbers>
3+
#include <cmath>
44

55
#include <Ark/Builtins/Builtins.hpp>
66

@@ -12,10 +12,10 @@ namespace Ark::internal::Builtins
1212

1313
namespace Mathematics
1414
{
15-
extern const Value pi_ = Value(M_PI);
15+
extern const Value pi_ = Value(std::numbers::pi);
1616
extern const Value e_ = Value(std::exp(1.0));
17-
extern const Value tau_ = Value(M_PI * 2.0);
18-
extern const Value inf_ = Value(HUGE_VAL);
17+
extern const Value tau_ = Value(std::numbers::pi * 2.0);
18+
extern const Value inf_ = Value(std::numeric_limits<double>::infinity());
1919
extern const Value nan_ = Value(std::numeric_limits<double>::signaling_NaN());
2020
}
2121

0 commit comments

Comments
 (0)