ieee_retrospective函数对浮点状态寄存器进行查询,以找出产生了哪些异常,并打印一条有关标准错误的消息来通知您哪些是已产生但尚未清除的异常。此消息通常如下所示;格式可能会随各编译器版本而变化:
Note: IEEE floating-point exception flags raised: Division by Zero; IEEE floating-point exception traps enabled: inexact; underflow; overflow; invalid operation; See the Numerical Computation Guide, ieee_flags(3M), ieee_handler(3M) |
Fortran 95 程序需要显式调用 ieee_retrospective,并使用 -xlang=f77 进行编译,以便与 f77 兼容库进行链接。
用 -f77 兼容标志进行编译,将启用程序终止时自动调用 ieee_retrospective 惯例。
可以使用 ieee_flags() 关闭任意或所有这些消息,方法是在调用 ieee_retrospective 之前清除异常状态标记。