# Re: REPRESENT revisited

"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

.

## Relevant Pages

• Re: Fraudulent eBay listing
... digit is never zero. ... Why filter on extraneous characters? ... Plain grep does not use true REs. ...
(rec.crafts.metalworking)
• Re: a challenge
... // if the remainder isn't zero. ... // recursively to convert it to a string ... // of the hundred's digit (there can be only ...
(alt.lang.asm)
• Re: a challenge
... // if the remainder isn't zero. ... // recursively to convert it to a string ... // of the hundred's digit (there can be only ...
(alt.lang.asm)
• Re: The next apocalypse
... At one time all area codes had either a zero or a one as the second ... it doesn't matter anymore. ... When I lived in Hawaii we had 6 digit phone numbers. ...
(rec.boats)
• Re: Float comparison
... Are you saying there is a set of reals close to zero that can't be ... possible in the remainder of the significand. ... that would require a more negative exponent than the exponent space ... but that means a method of denoting the denormalization. ...
(comp.lang.c)