Re: FLT_DIG
- From: Vincent Lefevre <vincent+news@xxxxxxxxxx>
- Date: Wed, 4 Mar 2009 11:01:13 +0000 (UTC)
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)
.
- References:
- FLT_DIG
- From: Jean-Marc Bourguet
- Re: FLT_DIG
- From: Vincent Lefevre
- Re: FLT_DIG
- From: woong
- FLT_DIG
- Prev by Date: Re: FLT_DIG
- Next by Date: Re: FLT_DIG
- Previous by thread: Re: FLT_DIG
- Next by thread: Rubbish still there
- Index(es):
Relevant Pages
|