Sortable floating point numbers
AssigneeSap SE
InventorsKlaus Kretzschmar, Nobuyoshi Mori
Life of this patent
Estimating the term…
Abstract
The invention comprises methods for manipulating floating point numbers on a microprocessor where the numbers are sortable. That is, the numbers obey lexicographical ordering. Hence, the numbers may be quickly compared using bit-wise comparison functions such as memcmp( ). Conversion may result in a sortable floating point number in the form of a sign, leading bits of the exponent, and sets of digit triples in the form of declets (sets of 10 bits). In a variable-length version, numbers may be compressed by storing the number of trailing zero declets in lieu of storing the zero declets themselves.
Claims10
1-8. (canceled)
A storage method, comprising:
- responsive to a number received according to IEEE754, assembling a continuous exponent field from a combination field (G) and following exponent field (F) thereof and assembling a significand field from the combination field and from a trailing significand field,
- concatenating the significand field to the exponent field, wherein data of the exponent field occupies more significant bit positions as compared to the positions of the significant field,
- organizing consecutive BCD values of the concatenated fields into BCD triplets,
- for each consecutive triplet of BCD values, transforming the triplet into binary valuations of the decimal number represented by the triplet, each transformed triplet yielding a binary declet,
- transforming any remaining BCD values not included in a triplet into a binary valuation, and
- storing the transformed binary valuation in a memory along with a representation of the number's sign.
A sorting method, comprising:
- responsive to a pair of numbers received according to IEEE754, for each number:
- assembling a continuous exponent field from a combination field (G) and following exponent field (F) thereof and assembling a significand field from the combination field and from a trailing significand field,
- concatenating the significand field to the exponent field, wherein data of the exponent field occupies more significant bit positions as compared to the positions of the significant field,
- organizing consecutive BCD values of the concatenated fields into BCD triplets,
- for each consecutive triplet of BCD values, transforming the triplet into binary valuations of the decimal number represented by the triplet, each transformed triplet yielding a binary declet,
- transforming any remaining BCD values not included in a triplet into a binary valuation, and
- storing the transformed binary valuation in a memory along with a representation of the number's sign;
- performing a bitwise comparison of the two numbers;
- and
- in response to the bitwise comparison, outputting the two numbers according to a sort order.
11-15. (canceled)
A computer-readable storage medium stored thereon executable instructions that when executed perform a storage method, the storage method includes:
- responsive to a number received according to IEEE754, assembling a continuous exponent field from a combination field (G) and following exponent field (F) thereof and assembling a significand field from the combination field and from a trailing significand field,
- concatenating the significand field to the exponent field, wherein data of the exponent field occupies more significant bit positions as compared to the positions of the significant field,
- organizing consecutive BCD values of the concatenated fields into BCD triplets,
- for each consecutive triplet of BCD values, transforming the triplet into binary valuations of the decimal number represented by the triplet, each transformed triplet yielding a binary declet,
- transforming any remaining BCD values not included in a triplet into a binary valuation, and
- storing the transformed binary valuation in a memory along with a representation of the number's sign.
A computer-readable storage medium stored thereon executable instructions that when executed perform a sorting method, the sorting method includes:
- responsive to a pair of numbers received according to IEEE754, for each number:
- assembling a continuous exponent field from a combination field (G) and following exponent field (F) thereof and assembling a significand field from the combination field and from a trailing significand field,
- concatenating the significand field to the exponent field, wherein data of the exponent field occupies more significant bit positions as compared to the positions of the significant field,
- organizing consecutive BCD values of the concatenated fields into BCD triplets,
- for each consecutive triplet of BCD values, transforming the triplet into binary valuations of the decimal number represented by the triplet, each transformed triplet yielding a binary declet,
- transforming any remaining BCD values not included in a triplet into a binary valuation, and
- storing the transformed binary valuation in a memory along with a representation of the number's sign;
- performing a bitwise comparison of the two numbers;
- and
- in response to the bitwise comparison, outputting the two numbers according to a sort order.
Dependencies are inferred from the claim text.