Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

abs()

Name: Anonymous 2008-09-27 21:40

which is faster, /prog/?

const int SIZE_OF_DOUBLE = sizeof(double) * 8;
double absoluteValue = (double)(bitset<SIZE_OF_DOUBLE>((unsigned long)value).set(SIZE_OF_DOUBLE - 1, 0).to_ulong());


VS.

double absoluteValue = abs(value);

OR

is there an easier way to unset a double-precision value's sign bit?

Name: Anonymous 2008-09-27 23:10

>>7
i looked at MinGW's source code for cmath and they call the function __builtin_fabs which (according to the comments in the file) is supposed to be defined by the compiler.

where can i find the implementation for GCC's __builtin_fabs?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List