Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 18, 2010, 9:46:16 PM (15 years ago)
Author:
rgrieder
Message:

Replaced mathematical constants with a common definition in Math.h.
Use math::pi, math::pi_d (double), math::e, etc. from now on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/util/ExprParser.cc

    r6417 r7184  
    3333
    3434#include "ExprParser.h"
     35
    3536#include <cmath>
    3637#include <cstring>
    3738#include <cstdlib>
     39#include "Math.h"
    3840
    3941// macros for easier if, else statements
     
    5052    {
    5153        this->failed_ = false;
    52         this->variables_["pi"] = 3.1415926535897932;
    53         this->variables_["e"] = 2.7182818284590452;
     54        this->variables_["pi"] = math::pi_d;
     55        this->variables_["e"] = math::e_d;
    5456    }
    5557
     
    328330                    value = sqrt(parse_last_argument());
    329331                CASE("degrees")
    330                     value = parse_last_argument()*180/3.1415926535897932;
     332                    value = parse_last_argument()*180/math::pi_d;
    331333                CASE("radians")
    332                     value = parse_last_argument()*3.1415926535897932/180;
     334                    value = parse_last_argument()*math::pi_d/180;
    333335                CASE("mod")
    334336                {
Note: See TracChangeset for help on using the changeset viewer.