Patent ID: 7685214

Claim:
A method, in a data processing system comprising a processor, for converting between a decimal floating-point number and an order-preserving format, the decimal floating-point number having a sign, a coefficient, an exponent, and a combination field, comprising: (a) adjusting, by the processor of the data processing system, the exponent, such that the coefficient has no leading zeros; (b) calculating, by the processor, exponent high bits, combination bits, and coefficient bits, wherein the exponent high bits is the exponent divided by three, wherein the combination bits is a combination of a remainder of the division of the exponent by three, with a most significant digit of the coefficient, wherein the coefficient bits is a grouping of the coefficient digits into groups of three digits, wherein each group of three digits is mapped to ten bits; (c) assembling, by the processor, in sequence a1, the exponent high bits, the combination bits, and the coefficient bits; and (d) inverting, by the processor, each of the assembled bits, if the decimal floating-point number is negative.