Negafibonacci coding: Difference between revisions

Content deleted Content added
cleaned up; still needs better referencing
Hyphen to minus for math
Line 13:
# Put a one in the ''N+1th'' bit to finish.
 
To decode a token in the code, remove the last "1", assign the remaining bits the values 1,-1 −1, 2,-3 −3, 5,-8 −8,13... 13… (the [[negafibonacci]] numbers), and add the "1" bits.
 
==Table==
 
The code for the integers from -11−11 to 11 is given below.
{| class="wikitable"
|-
Line 24:
!negaFibonacci code
|-
| -11−11 ||101000 ||0001011
|-
| -10−10 ||101001 ||1001011
|-
| -9−9 ||100010 ||0100011
|-
| -8−8 ||100000 ||0000011
|-
| -7−7 ||100001 ||1000011
|-
| -6−6 ||100100 ||0010011
|-
| -5−5 ||100101 ||1010011
|-
| -4−4 ||1010 ||01011
|-
| -3−3 ||1000 ||00011
|-
| -2−2 ||1001 ||10011
|-
| -1−1 ||10 ||011
|-
| 0 ||0 ||(cannot be encoded)