INF, Nan, Zero and IEEE/SANE arithmetic
The IEEE 754 standard for floating point arithmetic (related to a standard called SANE), specifies a standard for finite-precision floating point arithmetic.
Analytica 4.0 complies with IEEE 754 (and SANE). Note that Analytica 3.1 and earlier differed from this standard when multiplying by zero. If you have a legacy 3.1 model that relies on multiplication by zero to zero out INFs or NaNs, you will discover that downstream results are NaN in in Analytica 4.0.
To detect this situation, keep the "Show Result Warnings" preference on. A warning is displayed in Analytica 4.0 if you multiply INF or NaN by zero.
Under IEEE 754 and in Analytica, there are three special values: INF, -INF, and NaN, representing infinity, negative infinity and "Not a Number". The IEEE 754 and SANE standards specify the desired results of arithmetic operations involving these values. For example:
x / 0 = INF for x>0 0 / 0 = NaN x * INF = INF for x>0 0 * INF = NaN INF - INF = NaN x * NaN = NaN
Note: x>0 means x is not NaN but may be INF.
In Analytica 3.1 and earlier, 0*x resulted in 0 for any x, even x=NaN or x=INF.
To determine whether x is Nan, use the IsNaN(x) function. To determine whether x is INF or -INF, use the comparison x=INF or x=-INF. The IsNumber(x) function returns true for x=INF, x=-INF and x=NaN (but false for text strings, references, null, etc).
Enable comment auto-refresher