> Date: Fri, 17 Nov 2000 19:13:22 +0010
> From: [log in to unmask]
> >> >Even if it did, there's another reason for not using "dble" to change the
type
> >> >of this constant (particularly if it is in the executable section of the
> >> >program) --
> >> >
> >> >"dble" may require a function evaluation. 3.1541926d0 does not.
> >>
> >> Why? Do you know any compiler that would
> >
> >Would what? Question us unclear.
>
> Would require a function evaluation.
>
> >> -- even the lamentable Powerstation?
> >> We have had mixed mode arithmetic for ages.
> >
> >DBLE may be required for preparing an argument for
> >a subroutine call or function reference. It may also be required to force
> >the evaluation of an expression to be done in double precision rather
> >than in single precision.
>
> Yes, but I am still unclear as to why you believe any of these uses should ever
> require a function evaluation. Hoisting a single to a double precision variable
> should be doable without a function call.
Function evaluation at the Fortran level, to be sure.
Notice that I said "may require". You introduced "would".
That's an implentation issue. Whether a compiler produces
any code at all, inlines the conversion code, or -- as you suggest --
invokes a function, is up the to the compiler designer.
As for me, I ceased to be surprised at such ingenuities since
discovering that a certain compiler invoked a subroutine call to
convert an integer constant to floating point for the
assignment "x = 1"
> Regards, Paddy
> Paddy O'Brien,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|