[patch, fortran, committed] Document COMPLEX*k syntax quirk.

Brooks Moses brooks.moses@codesourcery.com
Thu Feb 22 22:35:00 GMT 2007


Brooks Moses wrote:
> Tobias Burnus wrote:
>>  where @code{TYPESPEC} is a basic type (@code{INTEGER}, @code{REAL},
>> +etc.), and where @code{size} is a byte count corresponding to a valid
>> +kind for that type; for the @code{COMPLEX} type the @code{size} is
>> +byte count of real plus imaginary part.
>> +The statement then declares @code{x}, @code{y} and
>> +@code{z} to be of type @code{TYPESPEC} with the appropriate kind. This
>> +is equivalent to the standard conforming declaration
>>  @smallexample
>>        TYPESPEC(k) x,y,z
>>  @end smallexample
>> +where @code{k} is equal to @code{size} for most types, but is equal to
>> +@code{size/2} for the @code{COMPLEX} type.
> 
> Hmm.  How about "...a byte count corresponding to the storage size of a 
> valid kind for that type."?  Since the storage size of a complex number 
> obviously includes both parts, that should make it clear without making 
> it overly complicated.

On second thought, you're right.  It doesn't hurt to be explicit about 
this.  How about this version?

...
where @code{TYPESPEC} is a basic type (@code{INTEGER}, @code{REAL},
etc.), and where @code{size} is a byte count corresponding to the
storage size of a valid kind for that type.  (For @code{COMPLEX}
variables, @code{size} is the total size of the real and imaginary
parts.)  The statement then declares @code{x}, @code{y} and @code{z} to
be of type @code{TYPESPEC} with the appropriate kind.  This is
equivalent to the standard conforming declaration
...

- Brooks



More information about the Fortran mailing list