Go to the source code of this file.
Functions | |
FENNEL_BEGIN_CPPFILE ("$Id: //open/dev/fennel/calculator/NoisyArithmetic.cpp#3 $") | |
static void | Raise (TExceptionCBData *pData, TProgramCounter pc, const char *pMsg) throw (CalcMessage) |
DO (char) DO(signed char) DO(unsigned char) DO(short) DO(unsigned short) DO(int) DO(unsigned int) DO(long int) DO(long unsigned int) DO(long long int) DO(long long unsigned int) DO(float) DO(double) DO(long double) inline void maybe_raise_fe_exception(TExceptionCBData *pExData | |
TProgramCounter pc | throw (CalcMessage) |
template<typename TYPE> | |
OP_FN_PROLOG | na_add (TYPE &res, const TYPE &r, const TYPE &l) |
template<typename TYPE> | |
OP_FN_PROLOG | na_sub (TYPE &res, const TYPE &r, const TYPE &l) |
template<typename TYPE> | |
OP_FN_PROLOG | na_mul (TYPE &res, const TYPE &r, const TYPE &l) |
template<typename TYPE> | |
OP_FN_PROLOG | na_div (TYPE &res, const TYPE &r, const TYPE &l) |
template<typename TYPE> | |
OP_FN_PROLOG | na_neg (TYPE &res, const TYPE &r) |
DO | ( | char | ) |
FENNEL_BEGIN_CPPFILE | ( | "$Id: //open/dev/fennel/calculator/NoisyArithmetic.cpp#3 $" | ) |
OP_FN_PROLOG na_add | ( | TYPE & | res, | |
const TYPE & | r, | |||
const TYPE & | l | |||
) |
OP_FN_PROLOG na_div | ( | TYPE & | res, | |
const TYPE & | r, | |||
const TYPE & | l | |||
) |
OP_FN_PROLOG na_mul | ( | TYPE & | res, | |
const TYPE & | r, | |||
const TYPE & | l | |||
) |
OP_FN_PROLOG na_neg | ( | TYPE & | res, | |
const TYPE & | r | |||
) |
OP_FN_PROLOG na_sub | ( | TYPE & | res, | |
const TYPE & | r, | |||
const TYPE & | l | |||
) |
static void Raise | ( | TExceptionCBData * | pData, | |
TProgramCounter | pc, | |||
const char * | pMsg | |||
) | throw (CalcMessage) [static] |
Definition at line 74 of file NoisyArithmetic.cpp.
Referenced by throw().
00079 { 00080 if (pData) { 00081 assert(pData->fnCB); 00082 (pData->fnCB)(pMsg, pData->pData); 00083 } 00084 throw CalcMessage(pMsg, pc); 00085 }
TProgramCounter pc throw | ( | CalcMessage | ) |
Definition at line 349 of file NoisyArithmetic.cpp.
References Raise().
00350 { 00351 int fe = ::fetestexcept(FE_ALL_EXCEPT); 00352 if (0) { 00353 } else if (fe & FE_DIVBYZERO) { 00354 Raise(pExData, pc, S_DIV0); 00355 } else if (fe & FE_UNDERFLOW) { 00356 Raise(pExData, pc, S_UNDR); 00357 } else if (fe & FE_OVERFLOW) { 00358 Raise(pExData, pc, S_OVER); 00359 } else if (fe & FE_INVALID) { 00360 Raise(pExData, pc, S_INVL); 00361 00362 /* leave this last because it occurs in conjunction with other 00363 flags */ 00364 } else if (fe & FE_INEXACT) { 00365 /* disabling inexact. for <float> 200.0 + 0.3 == 200.300003 and S_INEX 00366 gets set., so is too pedestrian a case to raise an error for 00367 Raise(pExData, pc, S_INEX); */ 00368 } 00369 }