Follow

RT @CompSciFact
Find the average of two unsigned integers without risking overflow:

(x & y) + ((x ^ y) >> 1)

Rounds down in the average isn’t an integer.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.