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-28 15:00

>>18
You don't know that! He could be a respected leader of a large data center that
spends all of its time calculating the absolute value of floats. For all you
know they spend half their cycles in that very function. The servers don't even
have a floating point unit! This could save his company millions in electricity
alone, and net him a big fat bonus to take home to his wife and kids, and take
them to the zoo, because he doesn't have to stay late at work anymore to watch
his computer farm crunch row after row of digits, turning minus to plus. That
does matter, Anonymous. It really does matter.

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