A method for conversion between a decimal floating-point number and an
order-preserving format has been disclosed. The method encodes numbers in
the decimal floating-point format into a format which preserves value
ordering. This encoding allows for fast and direct string comparison of
two values. Such an encoding provides normalized representations for
decimal floating-point numbers and supports type-insensitive comparisons.
Type-insensitive comparisons are often used in database management
systems, where the data type is not specified for values to compare. In
addition, the original decimal floating-point format can be recovered
from the order-preserving format.