<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 23, 2010, at 7:20 AMPDT, Steffen Geißinger wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,</div> <div> </div> <div><font color="#000000">i need to check if an overflow of an floating-point arithmetic operation occured.</font></div> <div><font color="#000000">Currently I'm doing something like this (for addition):</font></div> <div><font size="2"><font color="#000000" size="2"></font></font> </div> <div><font size="2"><font color="#000000" size="2">(LHS > 0 && RHS > 0 && sum <= 0)  || (LHS < 0 && RHS < 0 && sum >= 0)</font></font></div> <div><font size="2"><font color="#000000" size="2"></font></font> </div> <div><font size="2"><font color="#000000" size="2">This is checked for every addition. </font></font></div> <div>Is there a more efficient way like the intrisic for int overflow?</div> <div><font color="#000000"><font size="2"><font size="2">How is it possible to raise a signal like SIGFPE?</font></font></font></div></blockquote><br></div><div>If you're talking about compile-time arithmetic, you should be using the APFloat library, which figures this out for you.</div><div><br></div></body></html>