TValBool Real::Less ( const Real & cv ) const { // if both are undefined: if ( IsUndefined() && cv.IsUndefined() ) return TValBool::tfalse; // if only one is undefined: else if ( IsUndefined() || cv.IsUndefined() ) return TValBool::tundef; // else they are real numbers. return rvalue < cv.value(); }
TValBool Real::Equal ( const Real & cv ) const { // if both are undefined then are equals. if ( IsUndefined() && cv.IsUndefined() ) return TValBool::ttrue; // if only one is undefined: else if ( IsUndefined() || cv.IsUndefined() ) return TValBool::tundef; // else they are real numbers. return (rvalue >= cv.value() - RealPrecision::Tol.precision() && rvalue <= cv.value() + RealPrecision::Tol.precision() ) ? TValBool::ttrue : TValBool::tfalse; }
const Real Real::operator - (const Real &c) const { if (IsUndefined() || c.IsUndefined()) return Real(); // Devuelve un indefinido // else: return Real( value() - c.value() ); }
const Real Real::operator / (const Real &c) const { if (IsUndefined() || c.IsUndefined()) return Real(); // Devuelve un indefinido if (c == zero) return Real(); // else: return Real( value() / c.value() ); }