Re: Mapping rationals to binary strings while preserving order
- From: Janez Brank <sudjbran@xxxxxxxxxxxxxx>
- Date: Fri, 14 Jul 2006 19:17:09 +0200
On Fri, 14 Jul 2006, Chris wrote:
Maybe I'm not understanding the problem, but I think there's a much
simpler solution. Just store your number in a standard 4 or 8 byte IEEE
floating point format. The first few bits store the scale, and the rest
store the most significant bits of the value. It sorts lexicographically
just fine.
Yes, but I'm interested in a mapping that works for all rational numbers,
not just those that can be represented in the 4- or 8-byte IEEE format.
-----
Janez
.
- References:
- Mapping rationals to binary strings while preserving order
- From: Janez Brank
- Re: Mapping rationals to binary strings while preserving order
- From: Chris
- Mapping rationals to binary strings while preserving order
- Prev by Date: SQL query plan question
- Next by Date: Why LL(1) Parsers do not support left recursion?
- Previous by thread: Re: Mapping rationals to binary strings while preserving order
- Next by thread: How slow is O(n^2) ?
- Index(es):
Relevant Pages
|