floating-point-exceptions

Delphi XE2, TWebBrowser, float divide by zero

僤鯓⒐⒋嵵緔 提交于 2019-12-01 19:59:09
In Delphi 2010 and Delphi 2007 I am using Set8087CW on WebBrowserBeforeNavigate / WebBrowserDocumentComplete to prevent FPU errors inside ActiveX to cripple my application. But somehow this is not working in Delphi XE2, at least when in 64bit mode. When clicking links (any) I get "float divide by zero". (The initial loading of a website address or content into TWebBrowser works fine.) The callstack shows this to happen inside system32\D3D10Warp.dll (maybe used by IE9?) in response to TApplication.ProcessMessage (and some ??? inbetween the two) You will need to mask SSE exceptions on 64 bit

Visual Studio C++ 2008 / 2010 - break on float NaN

别来无恙 提交于 2019-11-28 18:40:23
Is there any way to set up Visual Studio (just upgraded from 2008 to 2010) to break, as if an assertion failed, whenever any floating point number becomes NaN, QNAN, INF, etc? Up until now I have just been using the assert(x == x) trick, but I would rather something implicit, so that I dont have to add assertions everywhere. Quite surprised I can't find an answer to this via google. Some stuff about 'floating point exceptions', but I'm not sure if they are the same thing, and I've tried enabling them in Visual Studio, but the program doesn't break until something catastrophic happens because

Enabling floating point interrupts on Mac OS X Intel

你离开我真会死。 提交于 2019-11-27 20:36:56
On Linux, feenableexcept and fedisableexcept can be used to control the generation of SIGFPE interrupts on floating point exceptions. How can I do this on Mac OS X Intel? Inline assembly for enabling floating point interrupts is provided in http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numerics/Mac_OSX_Numerics.pdf , pp. 7-15, but only for PowerPC assembly. Exceptions for sse can be enabled using _MM_SET_EXCEPTION_MASK from xmmintrin.h . For example, to enable invalid (nan) exceptions, do #include <xmmintrin.h> ... _MM_SET_EXCEPTION_MASK(_MM_GET_EXCEPTION_MASK() & ~

Visual Studio C++ 2008 / 2010 - break on float NaN

ぃ、小莉子 提交于 2019-11-27 11:39:06
问题 Is there any way to set up Visual Studio (just upgraded from 2008 to 2010) to break, as if an assertion failed, whenever any floating point number becomes NaN, QNAN, INF, etc? Up until now I have just been using the assert(x == x) trick, but I would rather something implicit, so that I dont have to add assertions everywhere. Quite surprised I can't find an answer to this via google. Some stuff about 'floating point exceptions', but I'm not sure if they are the same thing, and I've tried

Why does integer division by -1 (negative one) result in FPE?

久未见 提交于 2019-11-27 01:54:23
I have an assignment of expaining some seemingly strange behaviors of C code (running on x86). I can easily complete everything else but this one has really confused me. Code snippet 1 outputs -2147483648 int a = 0x80000000; int b = a / -1; printf("%d\n", b); Code snippet 2 outputs nothing, and gives a Floating point exception int a = 0x80000000; int b = -1; int c = a / b; printf("%d\n", c); I well know the reason for the result of Code Snippet 1 ( 1 + ~INT_MIN == INT_MIN ), but I can't quite understand how can integer division by -1 generate FPE, nor can I reproduce it on my Android phone

Enabling floating point interrupts on Mac OS X Intel

不羁的心 提交于 2019-11-26 20:24:54
问题 On Linux, feenableexcept and fedisableexcept can be used to control the generation of SIGFPE interrupts on floating point exceptions. How can I do this on Mac OS X Intel? Inline assembly for enabling floating point interrupts is provided in http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numerics/Mac_OSX_Numerics.pdf, pp. 7-15, but only for PowerPC assembly. 回答1: Exceptions for sse can be enabled using _MM_SET_EXCEPTION_MASK from xmmintrin.h . For example, to enable

Why does integer division by -1 (negative one) result in FPE?

耗尽温柔 提交于 2019-11-26 04:52:28
问题 I have an assignment of expaining some seemingly strange behaviors of C code (running on x86). I can easily complete everything else but this one has really confused me. Code snippet 1 outputs -2147483648 int a = 0x80000000; int b = a / -1; printf(\"%d\\n\", b); Code snippet 2 outputs nothing, and gives a Floating point exception int a = 0x80000000; int b = -1; int c = a / b; printf(\"%d\\n\", c); I well know the reason for the result of Code Snippet 1 ( 1 + ~INT_MIN == INT_MIN ), but I can\