Using floating-point fields in database file access paths
The collating sequence for records in a keyed database file depends on the presence of the Signed (SIGNED), Unsigned (UNSIGNED), and Absolute Value (ABSVAL) keywords in data description specifications (DDS). For floating-point fields, the sign is the farthest-left bit, the exponent is next, and the significant is last. The collating sequence with UNSIGNED specified is:
- Positive real numbers—positive infinity
- Negative real numbers—negative infinity
A floating-point key field with the SIGNED keyword specified, or defaulted to, in DDS has an algebraic numeric sequence. The collating sequence is negative infinity—real numbers—positive infinity.
A floating-point key field with the ABSVAL keyword specified in DDS has an absolute value numeric sequence. The following floating-point collating sequences are observed:
- Zero (positive or negative) collates in the same manner as any other positive/negative real number.
- Negative zero collates before positive zero for SIGNED sequences.
- Negative and positive zero collate the same for ABSVAL sequences.
You cannot use not-a-number (*NAN) values in key fields. If you attempt this, and a *NAN value is detected in a key field during file creation, the file is not created.
Parent topic:
Describing access paths for database files