Knowledge Base

BUG: FOR2932 Error in Round or Truncate of Extra Digits

PSS ID Number: 147758

Article Last Modified on 11/3/1999


The information in this article applies to:


This article was previously published under Q147758

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 query words: 4.00

Keywords: kbLangFortran KB147758
Technology: kbAudDeveloper kbFORTRANPower400NT kbFortranSearch kbZNotKeyword8