博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

由于需要安装了C++ Builder 5.0,同时遇到了一个EInvalidOp -- 'floating point operation'的异常。

在查询后得知:MS和Borland处理浮点数方式不同导致,MS默认忽略浮点异常,Borland则不会。

解决方法很简单,在代码初始化的地方加入以下代码:

_control87(MCW_EM, MCW_EM);  /* defined in float.h */

该文件需要#include "float.h"

 

该函数禁用Borland浮点异常