(j3.2006) Question about DIM

Bill Long longb
Tue Jan 12 09:35:06 EST 2016


On Jan 12, 2016, at 12:25 AM, Robert Corbett <robert.corbett at oracle.com> wrote:

> On 01/11/16 05:49, Bill Long wrote:
>> Perhaps a more interesting question is whether this relic is actually used?   I can?t remember ever seeing it, though with only 48 years of Fortran programming experience, I?m a relative newcomer. :)
>> 
>> If there was any motivation to update DIM, more interesting questions would be
>> 
>> 1) If X-Y is -0.0, is the result 0.0 or -0.0?
>> 
>> 2) If X-Y is NaN, what is the result?
> 
> I have not only seen DIM used, I have seen a bug report filed against it.  The 
> user called the function with integer arguments that overflowed when the 
> subtraction was done.  The function result was negative because of the 
> overflow.  The user claimed that the Fortran standard required the result to be 
> nonnegative.

I had also thought about potential problems with integers. The current wording seems to just ignore that case.  I suspect that we really intend something like

?If X > Y and X - Y is representable by the type and kind of X, the result is X - Y; otherwise the result is zero.?

Not exactly what we say now.  




> 
> I wrote my first Fortran program for a DEC PDP-8s in the summer of 1967.  I 

Mine was an IBM 1130 in the summer of 1968. (NSF Summer Science program for high school students. I wonder of they still have that.) 

Cheers,
Bill


> understand that that makes me a latecomer to Fortran relative to some on the 
> committee.
> 
> Bob Corbett
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Bill Long                                                                       longb at cray.com
Fortran Technical Support  &                                  voice:  651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101





More information about the J3 mailing list