39 if ( fabs( x - floor( x + 0.5) ) < 1.0e-5 )
49 return floor( nom/den + 0.5 );
51 return floor( nom/den );
60 return ( nom/den ) - floor( nom/den );
90 double maxabs=
acadoMax(fabs(x),fabs(y));
94 if ( fabs( x-y )/maxabs >= 10.0*TOL )
return BT_FALSE;
100 if ( fabs( x-y ) >= 10.0*TOL )
return BT_FALSE;
108 if ( x >= y - TOL )
return BT_TRUE ;
115 if ( x <= y + TOL )
return BT_TRUE ;
122 if ( x > y + TOL )
return BT_TRUE ;
129 if ( x < y - TOL )
return BT_TRUE ;
136 if ( x >= TOL )
return BT_TRUE ;
143 if ( x <= -TOL )
return BT_TRUE ;
177 if ( ( x > -1.0 ) || ( x < 1.0 ) )
187 if (x - floor(x) > 0.5)
190 return (
int)floor(x);
199 for (
int i = n; i > 1; --i)
207 return x < 0 ? floor(x) : ceil(x);
int acadoMax(const int x, const int y)
BooleanType acadoIsEqual(double x, double y, double TOL)
BooleanType acadoIsNegative(double x, double TOL)
BooleanType acadoIsGreater(double x, double y, double TOL)
#define CLOSE_NAMESPACE_ACADO
int acadoFactorial(int n)
BooleanType acadoIsStrictlySmaller(double x, double y, double TOL)
BooleanType acadoIsNaN(double x)
BEGIN_NAMESPACE_ACADO BooleanType acadoIsInteger(double x)
int acadoRoundAway(double x)
BooleanType acadoIsSmaller(double x, double y, double TOL)
BooleanType acadoIsPositive(double x, double TOL)
double acadoDiv(double nom, double den)
int acadoMin(const int x, const int y)
BooleanType acadoIsZero(double x, double TOL)
BooleanType acadoIsInfty(double x, double TOL)
BooleanType acadoIsFinite(double x, double TOL)
double acadoMod(double nom, double den)
#define BEGIN_NAMESPACE_ACADO
BooleanType acadoIsStrictlyGreater(double x, double y, double TOL)