cmplx and complex intrinsics

FX Coudert fxcoudert@gmail.com
Fri May 4 20:42:00 GMT 2007


Hi Brian,

> Is "complex" deprecated or obsolete in gfortran?

No. It's still supported. For some reason, it's undocumented,  
although I thought the list of undocumented intrinsics was recently  
reduced to the empty set.

> Should I be using dcmplx instead?

dcmplx is a GNU extension, while complex is standard Fortran. I  
suggest using complex(x,y,kind=8).

> Should documentation for complex be added?

Definitely.

> Should I expect cmplx to return a double precision value when supplied
> with double precision input, and possibly there is a bug here?

No, and no. The Fortran 2003 standard says about CMPLX (section  
13.7.20): "Result Characteristics. The result is of type complex. If  
KIND is present, the kind typeparameter is that specified by the  
value of KIND; otherwise, the kind type parameter is that of default  
real type."

> Thanks for reading this far.

Thanks for taking time to write all this!

FX



More information about the Fortran mailing list