Curious
Curious

Reputation: 21

What does this expression do?

Is there any interpretation of this expression in the decimal system? In other words, is it an efficient implementation of calculation using the logical operation in place of arithmetic operation?

1) A number N plus a hexadecimal, i.e. (N+0x7f) 2) take the bitwise AND with the bitwise NOT of the same hexadecimal.

(N+0x7f) & (~0x7f)?

Upvotes: 1

Views: 82

Answers (1)

Curious
Curious

Reputation: 21

It is changing N to the closest multiple of 0x7F which is greater than N.

Upvotes: 1

Related Questions