Re precision, etc.

Mike Cowlishaw MFC at
Fri Aug 22 13:55:41 PDT 2008

> You're still making the unjustified assumption that the choice of 
> cohort member is productive information.  The examples here have 
> shown that it is not, and it leads to bad results.  Things are much 
> simpler by not trying to make questionable distinctions between 
> 1000000000000 and 1e12.

You are quite right to question that last case (I think there is plenty of 
evidence that the choice of exponent is important and productive 'in real 
life' -- for example, the most common reason for calculators being 
returned as 'broken' is when a calculation such as 1.23 + 1.27 does not 
give 2.50). 

In that last case, indeed, (and perhaps naively) when I designed the Rexx 
language I decided that any 'positive exponent' case should be treated as 
though it were an integer: 1E+9 in the underlying representation was (and 
is, in classic Rexx) displayed/printed as 1000000000.

I now think that was a mistake -- it's not simpler; it is a 'special rule' 
that often confuses.  If one sees a number such as 1.23E+9 (as in 1.23 GHz 
for example), it's very misleading to convert that for display as 
1230000000 (units Hz).  It gets even worse in computing contexts, with all 
the usual arguments as to whether a GB is 1000 MB or 1024 MB (etc.).

So the general idea is: the string representation should provide a 
reversible and exact mirror of the underlying decimal number.  Your worry 
about the divide case is valid, but that is a concern about the division 
rules, not about the string representation (the division rules could have 
been written to always return an integer if the exponent would be positive 
and fits -- but that introduces a different set of problems).

[Separately .. I am having problems with my subscription to this 
discussion; I am getting digests but cannot convert to individual e-mails 
as I don't have a password.  So please keep cc: me on replies!]


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

More information about the Es-discuss mailing list