Re: FLT_DIG



In article <50c3b59c-d664-4c46-8b5d-95d34c001e1f@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
woong@xxxxxxxxx wrote:

Vincent Lefevre <vincent+n...@xxxxxxxxxx> wrote:
In article <8763iq9t4q....@xxxxxxxxxxxxxxxxx>,
Jean-Marc Bourguet <j...@xxxxxxxxxxxx> wrote:

The C90 formula seems the right one to me: if one imagine a 1 digit
floating point with radix 100, the C99 formula says that it can represent
any floating point number with 2 decimal digits while it is unable to
represent 420. The C90 gives the correct value.

Note that the standard requires FLT_DIG >= 6, so that this particular
example is invalid. But I agree: if b = 10^k, then 10^(kp) + 10^(k-1)
gives a counter-example. So, one must have q <= (p-1)*log10(b) + 1.


It's hard for me to follow your logic. Are you saying that, even if
the radix-100 fp format with one-digit precision cannot retain all
decimal digits of 420, the revised formula in C99 says it can? (It
never says it can, however.)

I'm saying that I agree with Jean-Marc: there's a problem with
the formula, which must be q <= (p-1)*log10(b) + 1, as a generic
counter-example shows that q = (p-1)*log10(b) + 2 is not OK (my
bound is correct, I leave the proof to the reader... but this
bound was the same as C90's).

But due to the FLT_DIG >= 6 condition, a 1-digit floating-point
system with radix 100 is not possible (I think the formula needs
to be correct only for possible implementations).

--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
.



Relevant Pages

  • Re: FLT_DIG
    ... floating point with radix 100, the C99 formula says that it can represent ... any floating point number with 2 decimal digits while it is unable to ... Jun, Woong ...
    (comp.std.c)
  • Re: FLT_DIG
    ... floating point with radix 100, the C99 formula says that it can represent ... any floating point number with 2 decimal digits while it is unable to ...
    (comp.std.c)
  • Re: Rude math :-)
    ... string, which I take it to mean "using decimal digits", as in BCD ... So, it's obvious that the "decimal" is refering to the radix, ... Greek and Latin? ... "erroneous" coinage of a hybrid-constructed word, in a hypothetical situation, ...
    (sci.math)
  • Re: why still use C?
    ... > floating point arithmetic done in a base directly supported by ... applications has clouded my ability to see the "need" to emulate ... hardware radix 10 capability would be orders of magnitude faster; ... language definition at this point by deciding that you've fallen ...
    (comp.lang.c)
  • Re: demonic problem descriptions
    ... > unacceptable for such calculations, ... we can't imagine the horrible confusion that surrounded pre-1985 floating ... Note that IBM floats had an interesting twist; their radix was 16, ... but when I first ported Franz Lisp to the IBM 360 ...
    (comp.lang.lisp)