Special Values
In addition to regular numeric values, RWDecimal and RWFixedDecimal classes can also take on one of three special non-numeric values: null, missing, or NaN. The null and missing values are useful because of their properties when used in calculations. In most cases, an arithmetic operation involving a number and null will result in the numeric operand. Using null allows the representation of a non-numeric value without propagating that value throughout the calculations. A missing value is different in that it will propagate through calculations; an arithmetic operation involving a missing value will have a missing value as a result. The NaN value is primarily an error value, for example, an NaN value will result from division by zero.
For information on how these values operate when used in calculations, see the enum RWDecimalBase::state.
Each RWDecimal<T> class has static members null, missing, and NaN that can be used to assign or test for these values. For example
RWDecimal<RWMP2Int> a = RWDecimal<RWMP2Int>::missing;
RWDecimal<RWMP2Int> b;
.
.
.
if(b == RWDecimal<RWMP2Int>::NaN) printError();