rvm 1.08
|
Safely manipulate numbers without worryiung about over/underflow error. More...
#include <rmath.h>
Public Member Functions | |
safe_num () | |
C'tor. | |
safe_num (const T a_num) | |
C'tor. | |
safe_num (const safe_num &a_class) | |
C'tor. | |
void | clear (void) |
Clear the value. | |
const T | value (void) const |
Return the value. | |
void | assign (const T &a_arg) |
Assign a value. | |
void | add (const T &a_arg) |
Add a value. | |
void | subtract (const T &a_arg) |
Subtract a value. | |
void | multiply (const T &a_arg) |
Multiply by a value. | |
void | divide (const T &a_arg) |
Divide by a value. | |
void | assign (const safe_num< T > &a_class) |
Assign a safe_num. | |
void | add (const safe_num< T > &a_class) |
Add a safe_num. | |
void | subtract (const safe_num< T > &a_class) |
Subtract a safe_num. | |
void | multiply (const safe_num< T > &a_class) |
Multiply by a safe_num. | |
void | divide (const safe_num< T > &a_class) |
Divide by a safe_num. | |
const bool | operator== (const T &a_arg) const |
Boolean operator. | |
const bool | operator== (const safe_num< T > &a_class) const |
Boolean operator. | |
const bool | operator!= (const T &a_arg) const |
Boolean operator. | |
const bool | operator!= (const safe_num< T > &a_class) const |
Boolean operator. | |
const bool | operator< (const T &a_arg) const |
Boolean operator. | |
const bool | operator< (const safe_num< T > &a_class) const |
Boolean operator. | |
const bool | operator> (const T &a_arg) const |
Boolean operator. | |
const bool | operator> (const safe_num< T > &a_class) const |
Boolean operator. | |
const bool | operator<= (const T &a_arg) const |
Boolean operator. | |
const bool | operator<= (const safe_num< T > &a_class) const |
Boolean operator. | |
const bool | operator>= (const T &a_arg) const |
Boolean operator. | |
const bool | operator>= (const safe_num< T > &a_class) const |
Boolean operator. | |
safe_num< T > & | operator+= (safe_num< T > a_class) |
Arithmetic operator. | |
safe_num< T > & | operator-= (safe_num< T > a_class) |
Arithmetic operator. | |
safe_num< T > & | operator*= (safe_num< T > a_class) |
Arithmetic operator. | |
safe_num< T > & | operator/= (safe_num< T > a_class) |
Arithmetic operator. | |
safe_num< T > & | operator%= (safe_num< T > a_class) |
Arithmetic operator. | |
Private Attributes | |
T | m_num |
Safely manipulate numbers without worryiung about over/underflow error.
C'tor.
Definition at line 285 of file rmath.h.
References safe_num< T >::clear().
C'tor.
Definition at line 291 of file rmath.h.
References safe_num< T >::clear(), and safe_num< T >::m_num.
C'tor.
Definition at line 298 of file rmath.h.
References safe_num< T >::clear(), safe_num< T >::m_num, and safe_num< T >::value().
void safe_num< T >::add | ( | const T & | a_arg | ) | [inline] |
Add a value.
Definition at line 323 of file rmath.h.
References absolute(), INTERNAL_ERROR, is_char(), safe_num< T >::m_num, and safe_num< T >::subtract().
Referenced by safe_num< T >::add(), operator+(), operator++(), safe_num< T >::operator+=(), and safe_num< T >::subtract().
Add a safe_num.
Definition at line 508 of file rmath.h.
References safe_num< T >::add(), and safe_num< T >::value().
void safe_num< T >::assign | ( | const T & | a_arg | ) | [inline] |
Assign a value.
Definition at line 317 of file rmath.h.
References safe_num< T >::m_num.
Referenced by safe_num< T >::assign(), operator%(), operator*(), operator+(), operator++(), operator-(), operator--(), and operator/().
Assign a safe_num.
Definition at line 502 of file rmath.h.
References safe_num< T >::assign(), and safe_num< T >::value().
void safe_num< T >::clear | ( | void | ) | [inline] |
Clear the value.
Definition at line 305 of file rmath.h.
References safe_num< T >::m_num.
Referenced by safe_num< T >::safe_num().
Divide by a safe_num.
Definition at line 526 of file rmath.h.
References safe_num< T >::divide(), and safe_num< T >::value().
void safe_num< T >::divide | ( | const T & | a_arg | ) | [inline] |
Divide by a value.
Definition at line 454 of file rmath.h.
References INTERNAL_ERROR, is_char(), and safe_num< T >::m_num.
Referenced by safe_num< T >::divide(), operator/(), and safe_num< T >::operator/=().
Multiply by a safe_num.
Definition at line 520 of file rmath.h.
References safe_num< T >::multiply(), and safe_num< T >::value().
void safe_num< T >::multiply | ( | const T & | a_arg | ) | [inline] |
Multiply by a value.
Definition at line 395 of file rmath.h.
References ASSERT, INTERNAL_ERROR, is_char(), and safe_num< T >::m_num.
Referenced by safe_num< T >::multiply(), operator*(), and safe_num< T >::operator*=().
const bool safe_num< T >::operator!= | ( | const safe_num< T > & | a_class | ) | const [inline] |
Boolean operator.
Definition at line 562 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator!= | ( | const T & | a_arg | ) | const [inline] |
Boolean operator.
Definition at line 552 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
Arithmetic operator.
Definition at line 684 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
Arithmetic operator.
Definition at line 668 of file rmath.h.
References safe_num< T >::multiply().
Arithmetic operator.
Definition at line 652 of file rmath.h.
References safe_num< T >::add().
Arithmetic operator.
Definition at line 660 of file rmath.h.
References safe_num< T >::subtract().
Arithmetic operator.
Definition at line 676 of file rmath.h.
References safe_num< T >::divide().
const bool safe_num< T >::operator< | ( | const T & | a_arg | ) | const [inline] |
Boolean operator.
Definition at line 572 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator< | ( | const safe_num< T > & | a_class | ) | const [inline] |
Boolean operator.
Definition at line 582 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator<= | ( | const T & | a_arg | ) | const [inline] |
Boolean operator.
Definition at line 612 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator<= | ( | const safe_num< T > & | a_class | ) | const [inline] |
Boolean operator.
Definition at line 622 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator== | ( | const safe_num< T > & | a_class | ) | const [inline] |
Boolean operator.
Definition at line 542 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator== | ( | const T & | a_arg | ) | const [inline] |
Boolean operator.
Definition at line 532 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator> | ( | const safe_num< T > & | a_class | ) | const [inline] |
Boolean operator.
Definition at line 602 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator> | ( | const T & | a_arg | ) | const [inline] |
Boolean operator.
Definition at line 592 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator>= | ( | const safe_num< T > & | a_class | ) | const [inline] |
Boolean operator.
Definition at line 642 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
const bool safe_num< T >::operator>= | ( | const T & | a_arg | ) | const [inline] |
Boolean operator.
Definition at line 632 of file rmath.h.
References safe_num< T >::m_num, and safe_num< T >::value().
void safe_num< T >::subtract | ( | const T & | a_arg | ) | [inline] |
Subtract a value.
Definition at line 356 of file rmath.h.
References absolute(), safe_num< T >::add(), INTERNAL_ERROR, is_char(), and safe_num< T >::m_num.
Referenced by safe_num< T >::add(), operator-(), operator--(), safe_num< T >::operator-=(), and safe_num< T >::subtract().
Subtract a safe_num.
Definition at line 514 of file rmath.h.
References safe_num< T >::subtract(), and safe_num< T >::value().
const T safe_num< T >::value | ( | void | ) | const [inline] |
Return the value.
Definition at line 311 of file rmath.h.
References safe_num< T >::m_num.
Referenced by safe_num< T >::add(), safe_num< T >::assign(), safe_num< T >::divide(), timer::eta(), safe_num< T >::multiply(), safe_num< T >::operator!=(), operator%(), safe_num< T >::operator%=(), safe_num< T >::operator<(), safe_num< T >::operator<=(), safe_num< T >::operator==(), safe_num< T >::operator>(), safe_num< T >::operator>=(), percent_string(), safe_num< T >::safe_num(), size_to_string(), safe_num< T >::subtract(), test5(), test6(), test8(), and vault_manager::usage().
Definition at line 692 of file rmath.h.
Referenced by safe_num< T >::add(), safe_num< T >::assign(), safe_num< T >::clear(), safe_num< T >::divide(), safe_num< T >::multiply(), safe_num< T >::operator!=(), safe_num< T >::operator%=(), safe_num< T >::operator<(), safe_num< T >::operator<=(), safe_num< T >::operator==(), safe_num< T >::operator>(), safe_num< T >::operator>=(), safe_num< T >::safe_num(), safe_num< T >::subtract(), and safe_num< T >::value().