(j3.2006) parameterized derived types
Robert Corbett
robert.corbett
Fri Dec 11 02:05:45 EST 2015
On 12/10/15 15:42, Bill Long wrote:
> I appreciate that users ask for ?slower, more accurate? versions of functions for various reasons. If they later complain that then are getting different answers, then the response is ?that?s what you asked for, wasn?t it?? This seems like something the standard should not get involved with. Maybe just a documentation notation reminding readers that the ?slower, more accurate? functions will return slightly different answer from the default functions. If they didn?t, there would be no point to the ?slower? bit.
>
I should have been clearer. My comments about the math libraries were intended
as part of the discussion about parameterized derived types. Malcolm suggested
that a possible solution to the problem was to ensure that component
specification expressions produce the same results regardless of whether they
are evaluated at compile-time or run-time. My point was that I do not have
control over which math library will be used for a given program, so making
guarantees about expressions that involve the intrinsic transcendental functions
is difficult but not impossible. Operations such as raising a value to a power
are also issues.
I could implement the desired functionality by adding the functions the compiler
uses to evaluate constant expressions to the Fortran run-time support library.
The functions will need to given new names, and for the sake of backward
compatibility, whenever one of the functions is changed in the compiler another
routine with a new name will have to be added to the library. This solution to
the problem would be hard to maintain, especially after I am gone.
Bob Corbett
More information about the J3
mailing list