Problem converting float -> double complex

Caspar Terheggen caspar at wn2.sci.kun.nl
Thu Oct 19 19:49:46 AEST 1989


This article is cross posted to two groups because I don't know
whether it's a Fortran or a Sun question. Can someone explain
this behavior? Is it valid Fortran77?

Script started on Thu Oct 12 09:30:00 1989
% more try.f
      complex*16 z1,z2
      z1 = 1.0
      z2 = 1.0/1.0
      write(*,*) z1,z2
      end
% make try
f77   -sun4 -o try try.f 
try.f:
 MAIN:
% try
  (    1.0000000000000,  0.)  (    25.968750000000,  0.)
% exit
script done on Thu Oct 12 09:30:20 1989

Why did the conversion to complex*16 go right in one case and wrong in the
other? I would expect that in both cases a real*4 must be converted to
complex*16. I am running SunOS 4.0.3_Export #1 on a Sun4. As for the
compiler: strings /usr/bin/f77 gives (among others) @(#)compile.c 1.70
88/04/18 SMI.  Any help (e-mail or followup) is appreciated. Thanks in
advance.



More information about the Comp.sys.sun mailing list