Skip to content

Commit ad28ef6

Browse files
committed
Fix compile errors
1 parent b93951c commit ad28ef6

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

include/constants.hpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
namespace steppable::constants
3232
{
3333
/// @brief 100 digits of pi.
34-
extern const std::string_view PI;
34+
constexpr const std::string_view PI =
35+
"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";
3536

3637
/// @brief Pi multiplied by 2.
3738
// Generated using Python:
@@ -43,7 +44,7 @@ namespace steppable::constants
4344
// 5 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
4445
// 6 | ) * Decimal(2)
4546
// -------------------------------------------------------
46-
extern const std::string_view TWO_PI;
47+
constexpr const std::string_view TWO_PI = "6.283185307179586231995926937088370323181152343750";
4748

4849
/// @brief Pi divided by 2.
4950
// Generated using Python:
@@ -55,7 +56,8 @@ namespace steppable::constants
5556
// 5 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
5657
// 6 | ) / Decimal(2)
5758
// -------------------------------------------------------
58-
extern const std::string_view PI_OVER_2;
59+
constexpr const std::string_view PI_OVER_2 =
60+
"1.570796326794896619231321691639751442098584699687552910487472296153908203143104499314017412835292542";
5961

6062
/// @brief Pi divided by 180 (to convert degrees to radians), correct to 100 decimal places.
6163
// Generated using Python:
@@ -67,7 +69,8 @@ namespace steppable::constants
6769
// 5 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
6870
// 6 | ) / Decimal(180)
6971
// -------------------------------------------------------
70-
extern const std::string_view PI_OVER_180;
72+
constexpr const std::string_view PI_OVER_180 =
73+
"0.01745329251994329508887757482524547311994764539930555555555555555555555555555555555555555555555555556";
7174

7275
/// @brief Pi divided by 200 (to convert grads to radians), correct to 100 decimal places.
7376
// Generated using Python:
@@ -79,7 +82,8 @@ namespace steppable::constants
7982
// 5 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
8083
// 6 | ) / Decimal(200)
8184
// -------------------------------------------------------
82-
extern const std::string_view PI_OVER_200;
85+
constexpr const std::string_view PI_OVER_200 =
86+
"0.01570796326794896619231321691639716312084074699687552942986246296153903203140449499314017412671058534";
8387

84-
extern const std::string_view E;
88+
constexpr const std::string_view E = "2.718281828459045090795598298427648842334747314453125";
8589
} // namespace steppable::constants

src/constants.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,5 @@
2727
// NOLINTBEGIN(cert-err58-cpp)
2828
namespace steppable::constants
2929
{
30-
constexpr const std::string_view PI =
31-
"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";
32-
constexpr const std::string_view TWO_PI = "6.283185307179586231995926937088370323181152343750";
33-
constexpr const std::string_view PI_OVER_2 =
34-
"1.570796326794896619231321691639751442098584699687552910487472296153908203143104499314017412835292542";
35-
constexpr const std::string_view PI_OVER_180 =
36-
"0.01745329251994329508887757482524547311994764539930555555555555555555555555555555555555555555555555556";
37-
constexpr const std::string_view PI_OVER_200 =
38-
"0.01570796326794896619231321691639716312084074699687552942986246296153903203140449499314017412671058534";
39-
constexpr const std::string_view E = "2.718281828459045090795598298427648842334747314453125";
4030
} // namespace steppable::constants
4131
// NOLINTEND(cert-err58-cpp)

0 commit comments

Comments
 (0)