PRB: DIM() Intrinsic Function does not Support Complex Numbers

ID: Q149749


The information in this article applies to:
  • Microsoft Fortran PowerStation for Windows 95 and Windows NT, version 4.0


SYMPTOMS

Attempting to use complex numbers as DIM() input arguments results in the following compilation error:

error FOR2325: wrong data type for argument number of intrinsic procedure DIM
The DIM() intrinsic function returns the difference between two input arguments if their difference is positive, or it returns zero otherwise. The DIM() intrinsic function no longer supports the use of complex numbers as input arguments. Note only the real part of the complex numbers is used to calculate the difference between the two input arguments.


RESOLUTION

Obtain the real part of the complex number, and use it as the DIM() intrinsic function input argument.

-or-

Compile the source file using the /4fps1 compiler option.


STATUS

This behavior is by design.


MORE INFORMATION

Sample Code to Illustrate Problem and Resolution


! Compile options needed: none

      real*8 d
      complex c1, c2
      c1 = (4.0, -1.0)
      c2 = (1.0, 4.2E3)
! comment the following line for first resolution
      d = DIM( c1, c2 )
! uncomment the following line for second resolution
!      d = DIM( real(c1), real(c2) )
      print *, d
      end 

Additional query words: 4.00

Keywords : kbFortranPS kbLangFortran
Version : :4.0
Platform : NT WINDOWS
Issue type :


Last Reviewed: November 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.