什么导致了浮点异常“1.#IO” [英] What leads to the floating point exception "1.#IO"

查看:1322
本文介绍了什么导致了浮点异常“1.#IO”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在很多Fortran文件中用很多计算来调试一个模拟。我习惯于看到一些浮点异常(-1。#QNB或1.#QNAN),这些异常涉及除零或超出浮点数最大值的操作。我假设-1。#IO意味着无效的操作,但我不确定数学是什么会导致这个,而不是QNB或QNAN或QINF。



会导致异常-1。#IO?

解决方案

<根据 IEEE 754浮点运算标准,无效操作的信号为


当NaN或无限操作数不能以目标格式表示时,不能以
表示[...]一个数字操作数将转换为
目标格式范围以外的整数,如果
不能以其他方式表示



此页举几个例子:


  • zero * infinity

  • 零/零

  • 无穷大/无穷大

  • 负操作数的平方根
  • d几个]

    I'm debugging a simulation with many calculations in many Fortran files. I am used to seeing some floating point exceptions (-1.#QNB or 1.#QNAN) for errors that involve division by zero or operations that exceed the maximum size for floating point number. I'm assuming -1.#IO means invalid operation, but I'm not sure mathematically what would cause this and not QNB or QNAN or QINF.

    What would lead to the exception -1.#IO?

    解决方案

    According to the IEEE 754 Standard for Floating Point Operations, the invalid operation is signaled

    when a NaN or infinite operand cannot be represented in the destination format and this cannot otherwise be indicated [...] When a numeric operand would convert to an integer outside the range of the destination format, the invalid operation exception shall be signaled if this situation cannot otherwise be indicated.

    This page gives a few examples:

    • zero * infinity
    • zero / zero
    • infinity / infinity
    • square root of a negative operand
    • [and a few more]

    这篇关于什么导致了浮点异常“1.#IO”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆