How do I, in as few operations as possible, round off a number in this way:
133, is (2^7) + (2^4) + (2^1)
It must become 127: (2^6) + (2^5) + (2^4) + (2^3) + (2^2) + (2^1)
And if for instance, the given number was 250, it would round to 255
Trivial?
ID:162575
Dec 21 2007, 7:09 am (Edited on Dec 21 2007, 7:15 am)
|
|