查看单个帖子
旧 2009-05-05, 11:00 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】floating point control flags getting cleared

floating point control flags getting cleared
floating point control flags getting cleared
we are using borland c++ with the dd-1.9 libraries.
when an oderror exception ("invalid index") is thrown from:
77e73887 c:\windows\system32\kernel32.dll
00e7e407 ___raisedebuggerexception
00e7e780 ___raisedebuggerexception
00e7e85a _throwexceptionldtc
009e18f8 oddbmtextimpl::composeforload
00ba6468 oddwgfileloader::loadobject
00ba5ad1 oddwgfileloader::loadobject
00ba3cb5 odobjloadresolver::queryx
00811a99 oddbobjectid:penobject
00811d6e oddbobjectid::safeopenobject
006007d0 dwgtosite:rocessentity(this=:0012f878, obj={ { { :00f755d4, null }, null }, :09c91500 })
the floating point control flags are cleared:
precision control (pc) from 2 to 0
rounding control from x to 0
infinity control from 1 to 0
this causes all floating point calculations to use single precision (pc=0)
instead of double (pc=2), so all our calculations are wrong.
strange. dd does not access fp processor flags. only odamfcapp::initinstance() sets them to cause "invalid double" exceptions in debug mode.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)