研究基于IEEE 754浮点标准下的浮点异常问题。针对C语言程序的上溢出、下溢出、被零除和无效运算这4类异常问题,结合C标准库中异常标记函数和区间运算的相关理论,提出两种针对性的异常检测的方法,分别解决对于函数特定值输入的异常检测和函数在某范围内的异常检测。研发相应的异常检测工具,自动重写待测程序,嵌入相应的异常检测方法。测试所得程序,实验结果表明,提出的两种异常检测方法可以有效检测浮点异常。
Floating-point exception problems based on IEEE 754 standard were studied.To detect the four kinds of exceptions named overflow,underflow,divide-by-zero and invalid operation in C language program,two targeted methods based on the exception-marking function in C standard library and interval arithmetic theory were proposed.These two methods can detect exceptions triggered by specific inputs or a range of inputs of the function.A corresponding exception detection tool was developed.The program was automatically rewritten and the corresponding methods were embedded in the program.The feasibility of the two exception detection methods was validated by practical application.