1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-04-10 19:20:44 +01:00

Infinity is now a math constant

This commit is contained in:
Antonin Portelli 2017-07-09 14:14:36 +01:00
parent 5641f3b481
commit 810c860256
2 changed files with 5 additions and 4 deletions

View File

@ -72,8 +72,9 @@ namespace MATH_NAMESPACE
DMat varToCorr(const DMat &var); DMat varToCorr(const DMat &var);
// Constants // Constants
const double pi = 3.1415926535897932384626433832795028841970; constexpr double pi = 3.1415926535897932384626433832795028841970;
const double e = 2.7182818284590452353602874713526624977572; constexpr double e = 2.7182818284590452353602874713526624977572;
constexpr double inf = std::numeric_limits<double>::infinity();
} }

View File

@ -689,8 +689,8 @@ void MathInterpreter::compile(RunContext &context)
{ {
if (root_) if (root_)
{ {
context.addVariable("pi", Math::pi); context.addVariable("pi", Math::pi);
context.addVariable("inf", HUGE_VAL); context.addVariable("inf", Math::inf);
ADD_STDMATH_FUNCS(context); ADD_STDMATH_FUNCS(context);
root_->compile(program_, context); root_->compile(program_, context);
for (unsigned int i = 0; i < program_.size(); ++i) for (unsigned int i = 0; i < program_.size(); ++i)