On Jun 14, 2006, at 11:46 AM, Neil N. Carlson wrote:
> On Wed, 2006-06-14 at 11:05 -0700, Richard E Maine wrote:
>> I assume you are aware that (-1.0)**2.0 is nonstandard
>
> Actually I'm not. I looked (but not hard :) and didn't find
> any Fortran book discussion of what arguments were allowed
> for exponentiation. Is this discussed in the Fortran standard?
Yes, but.... as with several things, you'd probably never find it if
you hadn't read the standard cover-to-cover multiple times and
recalled where it was. Yes, I've lost track of how many times I have
read it; being editor sort of forces you to do that. :-(
In f2003, 7.1.8 (pg. 128), 2nd sentence of the 2nd para (and in
corresponding places in other versions)
"Raising a negative-valued primary of type real to a real power is
prohibited."
This is not a constraint or otherwise anything that compilers are
required to detect. A compiler may do anything it wants with code
that does this.
Keith was "gentle" in his description of reactions to LIA. Most of
the reactions I've seen have not been printable. :-)
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|