On Thu, Aug 28, 2008 at 11:27 PM, Fomin Eduard S. <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> inline double abs(double x)
> {
>// remove sign bit
>*reinterpret_cast(&x) &= 0x7FFFLL;
...
> This simple code works correct in DEBUG. But i
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
inline double abs(double x)
{
// remove sign bit
*reinterpret_cast(&x) &= 0x7FFFLL;
return x;
}
int main(int argc, char *argv[])
{
std::cout << "abs = " << abs(-2.1) << std::endl;
}
This simple code works