Handling Floating-Point Exceptions in FORTRANLast reviewed: December 11, 1995Article ID: Q57918 |
The information in this article applies to:
SUMMARYThe 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:
MORE INFORMATIONThe following code example demonstrates using the LCWRQQ function to disable the overflow and divide by zero exceptions and their corresponding run-time errors.
Sample CodeC 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 ENDNOTE: In FORTRAN PowerStation, GETSTATUSFPQQ is equivalent to SSWRQQ, GETCONTROLFPQQ is equivalent to SCWRQQ, and SETCONTROLFPQQ is equivalent to LCWRQQ.
|
Additional reference words: kbinf 1.00 3.30 4.00 4.10 5.00 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |