Re: Summing array elements
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Summing array elements         

Group: comp.lang.fortran · Group Profile
Author: Gerry Ford
Date: Apr 22, 2008 21:31

"Richard Maine" wrote in message
news:1ifqm0o.di6px0khbs3kN%%nospam@see.signature...
> Gerry Ford wrote:
>
>
>> My compiler spits out an error here, Ron, and leaves me with warning
>> 179 -
>> Comparing floating point quantities for equality may give misleading
>> results.
>
> No, that is not an error. It is a warning. Error/=warning.

It's no big deal, but I *did* draw an error.
print *, SUM(a, MASK=MOD(a, 2)==1)

error 702 - The arguments of MOD must be of the same type and kind

When I changed 2 to 2.0, I was let go with a warning.

I'm sick today and decided to surf and read archives. I found this from you
on related topics in 2007:

This is an absolutely critical point that gets repeated here many times.
I suppose it has been a while. Time for the next repeat. :-)

There is a specific list of things that compilers are required to
detect. It is a tiny fraction of the requirements of the standard. The
general philosophy is that the compiler is required to diagnose things
that are always easily detectable at compile time. That's not the actual
rule, but that's the flavor of the motivation. There turn out to be many
rules where the simple cases are detectable at compile time, but
complicated cases aren't. The standard doesn't tend to require detection
of violation of those rules, but many compilers do detect the simple
ones.

Note that the f77 standard had *NO* required diagostics. I repeat
*NONE*. That doesn't mean that the f77 standard didn't have lots of
rules; the compiler just wasn't required to diagnose them.

Do not make the mistake of equating things that are illegal with things
that the compiler is required to diagnose. One is a rather small subset
of the other.

!end excerpt
Maybe this covers the 2008 rehashing. Who gets the stomach flu in April?
:-(
--
"Life in Lubbock, Texas, taught me two things: One is that God loves you
and you're going to burn in hell. The other is that sex is the most
awful, filthy thing on earth and you should save it for someone you love."

~~ Butch Hancock
no comments
diggit! del.icio.us! reddit!