Content deleted Content added
No edit summary |
No edit summary |
||
Line 35:
# Calculate the largest (or smallest) encodeable number with ''N'' bits by summing the odd (or even) [[negafibonacci]] numbers from 1 to ''N''.
# When it is determined that ''N'' bits is just enough to contain ''X'', subtract the ''Nth'' negaFibonacci number from ''X'' , keeping track of the remainder, and put a one in the ''Nth'' bit of the output.
# Working downward from the ''Nth'' bit to the first one, compare each of the corresponding negaFibonacci numbers to the remainder. Subtract it from the remainder if the absolute value of the difference is
# Put a one in the ''N+1th'' bit to finish.
|