0

I have dll which reads floating point values from binary files, makes simple calculation and gives boolean result. Each file is 8bytes length so variables are of type double ( Visual Studio 2008 ). Calculation is very simple:

if( fA < fB - ( iX * fC ) )
{
return( 1 );
}
else
{
return( 0 );
}

This dll is loaded and function is called by 2 different applications on same PC. For debug reasons values that are read from files are written to another files, calculations were split into parts and also written to files. Each app outputs same files except final result! One application gives 1, another 0. Dll compiled with /MT /fp:precise /Od options. Any ideas please?

4

1 回答 1

0

除非您的 DLL 竭尽全力在不同的体系结构上使用不同的路径(例如 387 路径和 SSE 路径),否则唯一的可能性是至少有一个应用程序会更改 FPU 状态。通常,这将是舍入模式,但在387 FPU的情况下,它也可以是指令计算的有效宽度(“x87 可以通过特殊的配置/状态寄存器配置为自动舍入为单或双每次操作后的精度”)。

于 2013-07-21T20:30:45.210 回答