(j3.2006) (SC22WG5.3792) Response on the TR29113 draft N1761

Robert Corbett Robert.Corbett at Sun.COM
Thu Dec 11 06:20:02 EST 2008


Aleksandar Donev wrote:
> Hi,
> 
> Thanks to train travel downtime, I was able to go through Reinhold's 
> missive. Some comments below.
> 
> Reinhold Bader wrote:
> 
>>Issue 5 - RANK intrinsic:
>>~~~~~~~~~~~~~~~~~~~~~~~~~~
>>Is this really needed considering we already have SIZE(SHAPE(X))?
> 
> Is AINT really necessary since you can write it so easily? I see no 
> reason not to add RANK just because it can be awkwardly handled already.

The intrinsic function AINT is not easy to implement, especially
if it is to be implemented in Fortran.  It is easy to write a
version that works for floating-point values that fit in an integer,
but for values between the largest integer and the largest
floating-point value that is not a pure integer, it is tricky.

I agree that adding a function RANK makes sense, even if it can
be implemented another way.  Most people would not immediately
recognized what SIZE(SHAPE(X)) does.  Most compilers would if it
became a common idiom, but Fortran code should be understandable
by humans as well as machines.

Bob Corbett


More information about the J3 mailing list