+ -
当前位置:首页 → 问答吧 → 谜题

谜题

时间:2011-11-29

来源:互联网

C/C++ code

Compute parity of word with a multiply

The following method computes the parity of the 32-bit value in only 8 operations using a multiply.
    unsigned int v; // 32-bit word
    v ^= v >> 1;
    v ^= v >> 2;
    v = (v & 0x11111111U) * 0x11111111U;
    return (v >> 28) & 1;



求解.

作者: walfud   发布时间: 2011-11-29

看不懂英文

作者: wzl9030   发布时间: 2011-11-29

判断奇偶性?

作者: woweiwokuang0000   发布时间: 2011-11-29