PRB: Run-Time Error 2101 From CMPLX Function Large Arguments
PSS ID Number: Q10635
Article last modified on 02-09-1993

3.20

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft FORTRAN for MS-DOS, version 3.2
----------------------------------------------------------------------

Summary:

SYMPTOMS
   An attempt to use the CMPLX intrinsic function to convert a REAL
   value to the COMPLEX data type fails and the following run-time
   message appears:

      ? Error: REAL math overflow
      Error Code 2101

CAUSE
   One of the real values is greater than approximately 3.4E+19. The
   CMPLX intrinsic function is designed to accept values of
   approximately 3.4E+38.

RESOLUTION
   Do not specify REAL values greater than 3.4E+19 as arguments to the
   CMPLX intrinsic function.

STATUS
   Microsoft has confirmed this to be a problem in FORTRAN version 3.2
   for MS-DOS. This problem was corrected in FORTRAN version 3.3 for
   MS-DOS.

More Information:

The following code example demonstrates this problem.

Sample Code
-----------

C Compile options needed: None

      COMPLEX C1
      DO 100 I = 1, 30
         C1 = CMPLX (10.0 ** I, 10.0 ** I)
         WRITE (*, *) I, CSQRT(C1), CABS(C1)
100   CONTINUE
      END

Additional reference words: 3.20

=============================================================================

Copyright Microsoft Corporation 1993.
