12.07.2015 Views

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 Intel <strong>Fortran</strong> <strong>Libraries</strong> <strong>Reference</strong>SyntaxCALL GETSTATUSFPQQ (status)status(Output) INTEGER(2). Floating-point processor status word.The floating-point status word shows whether various floating-point exception conditions haveoccurred. Intel® Visual <strong>Fortran</strong> initially clears (sets to 0) all status flags, but after an exceptionoccurs it does not reset the flags before performing additional floating-point operations. A statusflag with a value of one thus shows there has been at least one occurrence of the correspondingexception. The following table lists the status flags and their values:Parameter name Hex value DescriptionFPSW$MSW_EM Z'003F' Status Mask (set all flags to 1)FPSW$INVALID Z'0001' An invalid result occurredFPSW$DENORMAL Z'0002' A denormal (very small number) occurredFPSW$ZERODIVIDE Z'0004' A divide by zero occurredFPSW$OVERFLOW Z'0008' An overflow occurredFPSW$UNDERFLOW Z'0010' An underflow occurredFPSW$INEXACT Z'0020' Inexact precision occurredYou can use a logical comparison on the status word returned by GETSTATUSFPQQ to determinewhich of the six floating-point exceptions listed in the table has occurred.An exception is disabled if its flag is set to 1 and enabled if its flag is cleared to 0. By default, thedenormal, underflow and inexact precision exceptions are disabled, and the invalid, overflow anddivide-by-zero exceptions are enabled. Exceptions can be enabled and disabled by clearing andsetting the flags with SETCONTROLFPQQ. You can use GETCONTROLFPQQ to determinewhich exceptions are currently enabled and disabled.If an exception is disabled, it does not cause an interrupt when it occurs. Instead, floating-pointprocesses generate an appropriate special value (NaN or signed infinity), but the programcontinues. You can find out which exceptions (if any) occurred by calling GETSTATUSFPQQ.If errors on floating-point exceptions are enabled (by clearing the flags to 0 withSETCONTROLFPQQ), the operating system generates an interrupt when the exception occurs.By default, these interrupts cause run-time errors, but you can capture the interrupts withSIGNALQQ and branch to your own error-handling routines.For a full discussion of the floating-point status word, exceptions, and error handling, see "TheFloating-Point Environment" in your user’s guide.2-142

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!