Thomas Schodt <news0310@xenoc.$DEMON.co.uk> wrote in message news:<Xns94596C1F4B416xenoc@158.152.254.254>...
> (Thinkit) wrote in
> news: om:
> > So is radix manipulation with floating point standardized?
>
> Regular float/double are binary entities, check IEEE 754.
> They are only given a decimal representation in toString().
>
> It follows that they can be given a representation in
> any radix - the first one that comes to mind is binary.
>
>
> > I think there's no way you can avoid loss of accuracy,
> > but perhaps you can make that loss more consistent.
>
> The precision of IEEE 754 entities is well defined (consistent),
> for float it is 24 bits, for double it is 53 bits.
One of the reasons I wanted to do it in software is that you can get
over-precision errors due to the implementation in hardware. The
hardware uses a double extended with something like 50h bits of total
precision (in the x86). Now some other hardware might do exactly the
standard 40h bit double, in which case you can get an inconsistency.
I haven't thought much about arbitrary radix i/o to binary. Is it
especially complicated? Since I don't care about speed, I would like
something short and understandable. But why limit it to base 24h?
Why not each digit in hexadecimal (of course) with commas since a
digit may be more than one hexit.