运行软件碰到floating point division by zero,怎么解决??

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了运行软件碰到floating point division by zero,怎么解决??相关的知识,希望对你有一定的参考价值。

具体步骤如下:

1、遇到“floating point division by zero”报错,先打开“启动修复”。

2、重启按住F8进入系统高级选项模式,然后选择最后一次正确配置恢复系统。

3、正常进入系统后选择报错文件删除即可。

4、如果还出现,则进入带命令提示符的安全模式下,在命令提示符中输入del X:\\windows\\system32\\Drivers\\spoon.sys 命令删除报错文件即可。

参考技术A 运行软件碰到floating point division by zero,怎么解决
floating point division by zero,
意思是:浮点数被零除。
这是计算中的大问题,除法中,除数是不能为零的,程序中也一样。
所以,看起来这个程序有问题,
没有考虑到除数为零的情况。
这个问题只能通过修改程序代码来改善,别无他法。追问

两个题库软件,一个出现这样的情况,一个没有。

就是做题的模考软件

追答

是自己写的还是别人的?
自己的就检查除数部分代码,做个异常处理。
别人的则是无法可施,除非拿到源代码。
这是模考软件程序有bug。

upc组队赛14 Floating-Point Hazard求导

Floating-Point Hazard

题目描述

Given the value of low, high you will have to find the value of the following expression:
\(\sum_{i=low}^{high}(\sqrt[3]{(i+10^{-15})}-\sqrt[3]i)\)
If you try to find the value of the above expression in a straightforward way, the answer may be incorrect due to precision error.

输入

The input file contains at most 2000 lines of inputs. Each line contains two integers which denote the value of low, high (1 ≤ low ≤ high ≤ 2000000000 and high-low ≤ 10000). Input is terminated by a line containing two zeroes. This line should not be processed.

输出

For each line of input produce one line of output. This line should contain the value of the expression above in exponential format. The mantissa part should have one digit before the decimal point and be rounded to five digits after the decimal point. To be more specific the output should be of the form d.dddddE-ddd, here d means a decimal digit and E means power of 10. Look at the output for sample input for details. Your output should follow the same pattern as shown below.

样例输入

1 100
10000 20000
0 0

样例输出

3.83346E-015
5.60041E-015

题解

很有意思的求导公式,学到了
https://blog.csdn.net/wangws_sb/article/details/89676999

代码

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define scac(x) scanf("%c",&x)
#define sca(x) scanf("%d",&x)
#define sca2(x,y) scanf("%d%d",&x,&y)
#define sca3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define scl(x) scanf("%lld",&x)
#define scl2(x,y) scanf("%lld%lld",&x,&y)
#define scl3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z)
#define pri(x) printf("%d\n",x)
#define pri2(x,y) printf("%d %d\n",x,y)
#define pri3(x,y,z) printf("%d %d %d\n",x,y,z)
#define prl(x) printf("%lld\n",x)
#define prl2(x,y) printf("%lld %lld\n",x,y)
#define prl3(x,y,z) printf("%lld %lld %lld\n",x,y,z)
#define ll long long
#define LL long long
#define pb push_back
#define mp make_pair
#define P pair<int,int>
#define PLL pair<ll,ll>
#define PI acos(1.0)
#define eps 1e-6
#define inf 1e17
#define INF 0x3f3f3f3f
#define N 5005
const int maxn = 2000005;
double n,m;
double ans;
int cnt ;
int main()
{
  while(scanf("%lf %lf",&n,&m)&&n&&m)
  {
    ans = 0;
    rep(i,n,m+1)
      ans+= 1.0/3.0*pow(double(i),-2.0/3.0);
    cnt = 0;
    while(ans<1)
    {
      ans*=10.0;
      cnt--;
    }
    while(ans>=10)
    {
      ans/=10.0;
      cnt++;
    }
    printf("%.5lfE-%03d\n",ans,15-cnt);
  }
}

以上是关于运行软件碰到floating point division by zero,怎么解决??的主要内容,如果未能解决你的问题,请参考以下文章

安装windows优化大师,出现“floating point division by zero”错误?

电脑上出现floating point division by zero是怎么回事

为啥开机就会显示 Floating point division by zero !! 这是啥意思

应用程序发生错误 floating point division by zero 怎么解决

fluent中计算出现floating point exception是啥原因怎么解决

C# 无法从 'float' 转换为 'Microsoft.Xna.Framework.Point'