RE: [Algorithms] Radix sort question
Brought to you by:
vexxed72
From: Robert D. <RD...@ac...> - 2000-11-08 12:10:28
|
> Nope. To be able sort only by magnitude, as you suggested, you > would have to keep the values in the range (0.5, 1], which is not > quite useful anyway... > > Are, > F No idea what all this is about (too busy to read the preceding thread) but if you have floats in range 0-1 then you can easily convert them to range 0.5 to 1 with very little loss of accuracy (except for very tiny numbers) just by doing : f' = (f + 1.0) * 0.5 of course why you would want to bother is another matter, since positive floating point numbers can be compared as ints, and still produce correct results, so why not just sort on the whole thing ? Rob |