Difference between revisions of "INF, NAN, and Null"
(New page) |
|||
Line 5: | Line 5: | ||
:'''-Inf''' rmeans negative infinity or a number smaller than can be | :'''-Inf''' rmeans negative infinity or a number smaller than can be | ||
represented, e.g., -1/0 | represented, e.g., -1/0 | ||
− | :'''NAN''' means "Not A Number", where the result is numeric, but not a real number or | + | :'''NAN''' means "Not A Number", where the result is numeric, but not a real number or infinity -- e.g., Sqrt(-1) or 0/0 |
− | infinity -- e.g., Sqrt(-1) or 0/0 | + | :'''Null''' means that there is no such item. Slice, Subscript, Subindex, or MDTable return Null, for example, when trying to Slice out the nth slice over an Index with less than n values. |
− | :Null means that there is no such item. Slice, Subscript, Subindex, or MDTable | + | :'''Undefined''' means that a value has never been defined or is uncomputed -- for example, the value of an optional parameter not provided to a function. |
− | return Null, for example, when trying to Slice out the nth slice over an Index with less than n values. | ||
− | :'''Undefined''' means that a value has never been defined or is uncomputed. | ||
=== Computations with special values === | === Computations with special values === |
Revision as of 20:13, 3 February 2007
These are special values that Analytica returns in special conditions:
- Inf means infinity or a real number larger than can be
represented -- e.g., 1/0 or 1.797E307 * 10 (because it can't represent numbers larger than 1.796E308)
- -Inf rmeans negative infinity or a number smaller than can be
represented, e.g., -1/0
- NAN means "Not A Number", where the result is numeric, but not a real number or infinity -- e.g., Sqrt(-1) or 0/0
- Null means that there is no such item. Slice, Subscript, Subindex, or MDTable return Null, for example, when trying to Slice out the nth slice over an Index with less than n values.
- Undefined means that a value has never been defined or is uncomputed -- for example, the value of an optional parameter not provided to a function.
Computations with special values
Analytica follows ANSI (Association of National Standards Institutes) standards for computing with these special values, where applicable.
- 1/Inf %rarr; 0
- 1/(-Inf) %rarr; 0
- Inf + Inf %rarr; Inf
- Inf - Inf %rarr; NAN
It treats NULL as a "no-op", where possible, so:
- 10 + NULL %rarr; 10
- NULL - 10 %rarr; -10
- 1 AND NULL %rarr; 1
Comments
Enable comment auto-refresher