4 ms·
It depresses me that something as simple as int mask = v >> sizeof(int) * CHAR_BIT - 1; unsigned int r = (v ^ mask) - mask; can be granted a patent (h
by alextgordon 16y ago
It depresses me that something as simple as
int mask = v >> sizeof(int) * CHAR_BIT - 1;
unsigned int r = (v ^ mask) - mask;
can be granted a patent (http://graphics.stanford.edu/~seander/bithacks.html#IntegerAbs http://graphics.stanford.edu/~seander/bithacks.html#IntegerA...).
- yason 16y agoGranted, yes. There was discussion about whether the patent is at all valid, given abundant prior art. However, it depresses me too because you probably need lots of money and possibly a lawsuit to settle out the validity issue.