Binary operations on doubles in C
问题 I'm working on a high speed computing problem for a large scale simulation. In order to speed up the process I wish to make a couple of optimizations, one of which is to compute the absolute value of a double in only a couple of cycles without jumps. My idea was, that 64-Bit double values are represented with a 1-Bit sign Bit, an 11-Bit exponent and a 52-Bit Mantissa. So a double value XOR-ed with a mask: 10000000 00000000 00000000 00000000 would yield the desired result: double abs(double x)