[RESOLVED] Bit manipulation
Hi,
Say I have an x number of bits and I'd like to know all possibilities for that number, but only half of the bits can be toggled at the time.
For 4 bits these would be:
Code:
0011
0110
1100
1010
0101
1001
What would be a methodical way of getting those for a bigger x?
Thanks :)
Re: [RESOLVED] Bit manipulation
So the answer was the correct one?
Re: [RESOLVED] Bit manipulation
Re: [RESOLVED] Bit manipulation
:eek: I'd never expect Calc to give out a rounding error. How'd you find out about the error?
Re: [RESOLVED] Bit manipulation
I asked for a hint on the Project Euler forum.
They said my accuracy was off and suggested something like Google calc. Used Wolfram to calculate the exact answer.
Weird thing is that my TI-84 plus gives the same rounding error.
I'll have to check if I have some accuracy setting I can modify...