• + 1 comment

    I finally understand what you say!

    -

    But your "problem statement" is really hard to interpret in accordance to idea that you have explained in this forum!

    -

    In fact, your "problem statement" asserts that:

    If N is not a power of 2, they reduce the counter by the largest power of 2 less than N.
    

    Let N be equal to 42 (aka 0b101010).

    I'm really sorry to contradict you, but every english-speaking person agree with me that "the largest power of 2 less than 42" is 32 (aka 0b100000)!! Right?

    -

    Anyway, according to your really badly stated idea, what is "the largest power of 2 less than 42"?

    Is it 8 (aka 0b001000)?!

    Or is it 2 (aka 0b000010)?!

    -

    In your opinion, what is the largest power of 2 less than 63 (aka 0b111111)?

    32 (aka 0b100000)?!

    16 (aka 0b010000)?!

    8 (aka 0b001000)?!

    4 (aka 0b000100)?!

    2 (aka 0b000010)?!

    1 (aka 0b000001)?!

    -

    Would do you improve the "problem statement", please? Thanks!

    Sergio