Handling of NaN, inf, and -inf results

Operations in EQL adhere to the conventions for Not a Number (NaN), inf, and -inf defined by the IEEE 754 2008 standard for handling floating point numbers.

In cases when it has to perform operations involving floating point numbers, or operations involving division by zero or NULL values, EQL expressions can return NaN, inf, and -inf results.

For example, NaN, inf, and -inf values could arise in your EQL calculations when:
  • A zero divided by zero results in NaN
  • A positive number divided by zero results in inf
  • A negative number divided by zero results in -inf

For most operations, EQL treats NaN, inf, or -inf values the same way as any other value.

However, you may find it useful to know how EQL defines the following special values:
Type of operation How EQL handles NaN, inf, and -inf
Arithmetic operations Arithmetic operations with NaN values result in NaN values.
Filters NaN values do not pass filters (except for <>).

Any other comparison involving a NaN value is false.

Sorting For any sort order specified, EQL returns:
  1. Normal records
  2. Records with a NaN value
  3. Records with a NULL value
The following example shows how inf and -inf values are treated in ascending and descending sort orders:
ASC         DESC
----        ----
-inf        +inf
-4          3
0           0
3           -4
+inf        -inf
NaN         NaN
NULL        NULL