BUG: FOR2932 Error in Round or Truncate of Extra Digits

Last reviewed: February 29, 1996
Article ID: Q147758
The information in this article applies to:
  • Microsoft Fortran PowerStation for Windows 95 and Windows NT, version 4.0

SYMPTOMS

The following error message may be generated by the compiler when it initializes a REAL*4 variable with a constant near the maximum values allowed for REAL*4 numbers.

   error FOR2932: single-precision REAL literal constant out of range

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The maximal values of single precision negative numbers is in the range of -3.4028235E+38 to -1.1754944E-38 and for single-precision positive numbers is in the range of +1.1754944E-38 to +3.4028235E+38.

The following code demonstrates the problem.

Sample Code

C Compile options needed: none

      real*4 x1

      x1 = huge(1.0)
      write (*,100) x1
      x1 = 3.402823466385288787198009999e38      ! in range here.
      write (*,100) x1
      x1 = 3.4028234663852887871980100e38        ! out of range here.
      write (*,100) x1
      x1 = 3.4028234663852887871989999e38        ! to here.
      write (*,100) x1
      x1 = 3.4028234663852887871990e38           ! in range here
      write (*,100) x1
      x1 = 3.4028234663852887871990099999999e38  ! to here.
      write (*,100) x1
      x1 = 3.40282346638528878719901e38          ! then out of range here.
      write (*,100) x1
100 format (e16.9)
      end


Additional reference words: 4.00
KBCategory: kbprg kbbuglist
KBSubcategory: FORTLngIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.