[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [f-cpu] Re: Floating-Point?





> It's true to say that a decimal system can always accurately display the
> decimal equivalent of a binary number, but the reverse isn't necessarily
> true, and that therefore decimal systems can accurately represent more
> numbers than binary.

Yeah.

For the purpose of F-CPU, I'd say let's support at least 64 bit FP, 32 is
not enough,
and for 128 there might be no data type support from programming languages
(i.e. compilers assuming max. FP bit depths). I don't know if FP
portability is really
an issue with this processor, but if we do 128 or 256 bits, we have to
support 32,
64, 80, and 96 as well. (the latter four are IEEE standards).

[off-topic]
> If you are only using 2 decimal places then I can imagine such errors
> occuring. The rule should always be to internally use somewhat greater
> precision than you need to display externally, so that any rounding
errors
> nearly always remain invisible.

The problem was that the data was stored in database fields with fixed
precision (two decimal points), in ASCII format. When retrieved, conversion
errors occurred, and the system internally did conversions from and to
strings all the time (before and after computations in string fields).
We solved the problem by providing a configurable rounding mechanism,
which could be set, for example, to 4 decimal places. Still, manual
rounding
in computation expressions for some special cases was necessary.
Arbitrary-length BCD- or fixed-/floating-point arithmetic maybe could have
eliminated the problems, but we couldn't change it because there was so
much code that did manual rounding, working around the existing problem.
lol

> Of course, regardless of how much space programmers had allowed on
screens
> for the DJI, internally the applications most definitely did not use
4-digit
> BCD representation. Inevitably when the Dow did eventually pass 10,000
> nothing happened and equally inevitably, the media conveniently forgot
about
> the earlier scare stories.

That doesn't surprise me. Thank god that the code wasn't written in COBOL!
;-)
[/off-topic]


*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/