Java Programming 2

来源:互联网 发布:手机淘宝怎样退换货 编辑:程序博客网 时间:2024/05/16 07:44

To make the code more efficiently, instead of simply dividing or multiplying the 16, 32, 64, we could move the bits.


private static int ACT_SIZE = 32;y * ACT_SIZE

We could change it to

private static int SIZE_ROL = 5;x << SIZE_ROL

However, we should also notice that the sequence of executing is, multiply/divide->add/minus->shifting bits.

Thus, the code shoud be like this,

(points[i].x << SIZE_ROL) + 7




原创粉丝点击