<html>
<head>
<title></title>
<meta name="GENERATOR" content="MSHTML 8.00.6001.18812"></meta>
</head>
<body>
<div>Hallo</div>
<div> </div>
<div>Maybe this is my lack of c-knowledge, but i'm very confused of the behavior of LW_ABS</div>
<div> </div>
<div>The code below I thought would return -1, but i returns -3.</div>
<div> </div>
<div>Is this expected behavior?</div>
<div> </div>
<div>Why do we have LW_ABS() instead of fabs() ?</div>
<div> </div>
<div><br />
#include <stdio.h> <br />
#define LW_ABS(a) ((a) < (0) ? (-a) : (a))</div>
<div>int main() <br />
{<br />
int d,e,f;<br />
d = 1;<br />
e = -2;<br />
f = LW_ABS(d+e);</div>
<div>printf ("%d\n",f );<br />
return 0;<br />
}<br />
</div>
<div> </div>
<div>Thanks</div>
<div>Nicklas</div>
</body>
</html>