DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 57918 - Last Review: August 23, 2013 - Revision: 2.0

 
This article was previously published under Q57918
This article has been archived. It is offered "as is" and will no longer be updated.

On This Page

SUMMARY

The IEEE floating point standard defines the following five exceptions: invalid operation, divide by zero, overflow, underflow, and precision. The Microsoft FORTRAN run-time libraries provide the following three routines to obtain and modify the value of the status and control words:

  • The store-status-word (SSWRQQ) function returns the value of the status word.
  • The store-control-word (SCWRQQ) function returns the value of the control word.
  • The load-control-word (LCWRQQ) function sets the control word to a specified value.
An application can specify the manner to handle an exception by changing the control word and can determine which exceptions have occurred by checking the value of the status word.

MORE INFORMATION

The following code example demonstrates using the LCWRQQ function to disable the overflow and divide by zero exceptions and their corresponding run-time errors.

Sample Code

C Compile options needed: None

      INTERFACE TO SUBROUTINE LCWRQQ(CW)
      INTEGER*2 CW
      END

      PROGRAM NOEXCEPTIONS

      INTEGER*2 CW
      PARAMETER(CW = 16#133F)
      REAL*4 X, Y, Z

      X = 1.0
      Y = 0.0

      CALL LCWRQQ(CW)

      Z = X / Y

      END
				
NOTE: In FORTRAN PowerStation, GETSTATUSFPQQ is equivalent to SSWRQQ, GETCONTROLFPQQ is equivalent to SCWRQQ, and SETCONTROLFPQQ is equivalent to LCWRQQ.

APPLIES TO
  • Microsoft FORTRAN Compiler 3.3
  • Microsoft FORTRAN Compiler 3.31
  • Microsoft FORTRAN Compiler 4.0
  • Microsoft FORTRAN Compiler 4.01
  • Microsoft FORTRAN Compiler 4.1
  • Microsoft FORTRAN Compiler 5.0
  • Microsoft FORTRAN Compiler 5.1
  • Microsoft FORTRAN PowerStation 1.0 Standard Edition
  • Microsoft Fortran PowerStation 1.0a for MS-DOS
  • Microsoft FORTRAN PowerStation 32
Keywords: 
kbnosurvey kbarchive kblangfortran KB57918
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support