I'm writing here because although I can read c.l.f, I cannot reply.
This is probably also in the spirit of this mailing list.
There are so many queries on code which purport to be using double
precision but are omitting the D0 at the end of a constant. Isn't it
about time that the standard made it mandatory that the constant is
hoisted to the kind of the variable being assigned to, or in an
expression hoisted to the greatest precision in that expression.
I cannot believe that this change will ever break any code, rather it
will do what we (and there seem to be many of us falling into this trap)
naive programmers thought that we were getting.
We don't have to do this for any different kind of integers, so apart
from history why do we need it for reals? What benefit did this dubious
history give us that it has never been changed ( -- is it there just to
keep Richard Maine's typing skills updated :-))? IIRC, there was (is)
some oddity about complex numbers in this respect. Once generic
intrinsics came in, they seem to make nonsense of this.
On the two platforms that I have to support, my vendor is the same and
they do this hoisting. If we have to move to a new platform, we shall
surely have a lot of work on regression testing in order to check code
that has been written for these platforms for nearly a quarter of a
century (one anyway). And the authors used the "laxity" of this vendor,
perhaps unwittingly not realising the D0 trap.
My last 20 or so years have been with the same vendor (Digital/Compaq --
I cannot say HP because they have their own Fortran compiler for their
Unix). So, other than what I have read mainly in c.l.f, I forget
whether or not this hoisting occurred on the other platforms I
programmed for.
I'm pretty certain that hoisting is done within expressions for
variables, and believe it to be part of the standard. My belief in this
respect may not be reality.
Regards, Paddy
***********************************************************************
"This electronic message and any attachments may contain privileged
and confidential information intended only for the use of the
addressees named above. If you are not the intended recipient of
this email, please delete the message and any attachment and advise
the sender. You are hereby notified that any use, dissemination,
distribution, reproduction of this email is prohibited.
If you have received the email in error, please notify TransGrid
immediately. Any views expressed in this email are those of the
individual sender except where the sender expressly and with
authority states them to be the views of TransGrid. TransGrid uses
virus scanning software but excludes any liability for viruses
contained in any attachment.
Please note the email address for TransGrid personnel is now
[log in to unmask]"
***********************************************************************
|