69,371
社区成员
发帖
与我相关
我的任务
分享
double a = 0.0;
double d = -1.0 / a;
#include <algorithm>
#include <list>
#include <iostream>
#include <stdlib.h>
using namespace std;
union
{
struct
{
int l;
int h;
} i;
double d;
} num;
int main( )
{
num.i.l = 0xffffffff;
num.i.h = 0x7fefffff;
cout.precision(16);
cout<<num.d<<endl;
num.i.l = 0xffffffff;
num.i.h = 0x7fffffff;
cout.precision(16);
cout<<num.d<<endl;
system("pause");
return 0;
}