简体   繁体   English

在VS2010中使用长双精度编译Windows C ++应用程序

[英]Compiling Windows C++ application with long doubles in VS2010

At work we have MSVS2010 Ultimate, and I'm writing a program which runs exhaustive simulations using real numbers. 在工作中,我们有MSVS2010 Ultimate,我正在编写一个程序,使用实数运行详尽的模拟。 I'm getting non-trivial round-off errors and I've already taken reasonable steps to ensure my algorithm is as numerically stable as possible. 我得到了非平凡的四舍五入错误,我已经采取了合理的措施来确保我的算法尽可能在数值上稳定。

I'd like to switch to 128-bit quadruple precision floating point numbers (long double, right?), to see how much of a difference it makes. 我想切换到128位四倍精度浮点数(长双倍,对吗?),看看它有多大差异。

I've replaced all relevant instances of double with long double , recompiled, and ran my dummy simulation again but have exactly the same result as before. 我已经更换了所有相关实例doublelong double ,重新编译,并再次运行我的虚拟仿真,但具有完全相同的结果如前。

These are my (debug) compiler options as per my project property page in C/C++: 根据我在C / C ++中的项目属性页面,这些是我的(调试)编译器选项:

/ZI /nologo /W3 /WX- /Od /Oy- /D "_MBCS" /Gm /EHsc /RTC1 /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"Debug\\FFTU.pch" /Fa"Debug\\" /Fo"Debug\\" /Fd"Debug\\vc100.pdb" /Gd /analyze- /errorReport:queue / ZI / nologo / W3 / WX- / Od / Oy- / D“_MBCS”/ Gm / EHsc / RTC1 / GS / fp:precise / Zc:wchar_t / Zc:forScope /Fp"Debug\\FFTU.pch“/ Fa “Debug \\”/ Fo“Debug \\”/ Fd "Debug\\vc100.pdb“/ Gd / analyze- / errorReport:queue

My dev CPU is a Core2 Duo T7300 but the target machine will be an i7. 我的开发CPU是Core2 Duo T7300,但目标机器将是i7。 Both installations are Windows 7 64-bit. 两种安装都是Windows 7 64位。

You could switch to a non-Microsoft compiler such as gcc , Borland, or Intel. 您可以切换到非Microsoft编译器,如gcc ,Borland或Intel。 Those all recognize long double as 80-bit extended precision, the native internal format of the 8087. 这些都承认long double 80位扩展精度,8087的本机内部格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM