Dotcpp  >  编程教程  >  float.h头文件  >  C语言_status87()函数:获取浮点处理器状态值

C语言_status87()函数:获取浮点处理器状态值

点击打开在线编译器,边学边练

函数名:_status87

头文件:<float.h>

函数原型:  unsigned int _status87(void);

功能: 获取浮点处理器状态值

参数: 没有参数

返回值:返回浮点处理器状态值


程序:

#include<stdio.h>

#include<float.h>

int main(){

   float x;

   double y=1.5e-100;

   printf("Status87 before error: %x\n",_status87());  //输出当前状态

   x=y;  //强制产生一个错误

   y=x;

   printf("Status87 after error: %x\n",_status87());  //输出当前状态

   return 0;  

}

 

运行结果:

Status87 before error: 0
Status87 after error: 3



本文固定URL:https://www.dotcpp.com/course/450

C语言函数库
assert.h头文件
ctype.h头文件
float.h头文件
io.h头文件
math.h头文件
mem.h头文件
setjmp.h头文件
stdio.h头文件
stdlib.h头文件
sigal.h头文件
string.h头文件
time.h头文件
Dotcpp在线编译      (登录可减少运行等待时间)