Re: REPRESENT revisited
- From: "Ed" <nospam@xxxxxxxxxxx>
- Date: Thu, 8 Sep 2005 11:50:16 +1000
"Anton Ertl" <anton@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2005Sep5.202959@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> "Ed" <nospam@xxxxxxxxxxx> writes:
> >
> > If u is zero the string shall consist of one digit representing
> > the fractional significand r rounded to a whole number, either
> > one or zero, with an implied decimal point to the left of the
> > digit.
>
> That's a change from the current version, and since it changes a case
> that is currently defined, it is not a compatible change.
> ...
> > As the above table shows we are merely extending REPRESENT
> > in a logical direction.
>
> No, the logical continuation is:
>
> 0.6489 0 '' 0
You are assuming Standard REPRESENT requires u to include
the value zero. Not only is that uncertain - it produces nothing
that is useful.
Far better to assume not, for then we can have u=0 do something
that is not only useful, but essential.
Every practical application I've seen to date has wanted a different
outcome to the one you're suggesting. In every instance where u
has evaluated to 0, it became necessary to round the left-most
significant digit - without exception.
If you want to fix F.RDP then you have no option but to implement
the proposed change - or do your own rounding using a work-around.
> Interestingly,
>
> 0.0096E 5 2 0 F.RDP
>
> prints 0.01.
That's because for this case u=1 which REPRESENT *can* handle.
> However, I guess that few, if any, programs actually call REPRESENT
> with u=0, so one might get away with changing the behaviour for that
> case.
Perhaps you miss the significance.
The u=0 condition potentially occurs in every application that displays
numbers in fixed-point notation rounded to n decimal places.
That's literally millions of everyday applications - that REPRESENT
cannot properly handle. You've seen what it does in F.RDP
Ed
.
- Follow-Ups:
- Re: REPRESENT revisited
- From: Anton Ertl
- Re: REPRESENT revisited
- References:
- REPRESENT revisited
- From: Ed
- Re: REPRESENT revisited
- From: Anton Ertl
- REPRESENT revisited
- Prev by Date: Re: Code compaction
- Next by Date: Re: rounding FP to u significant digits
- Previous by thread: Re: REPRESENT revisited
- Next by thread: Re: REPRESENT revisited
- Index(es):
Relevant Pages
|