Talk:Fibonacci coding
Big-endian and little-endian?
Can anyone substantiate the premise that there are two separate incompatible systems, big-endian and little-endian, for encoding integers as the sum of Fibonacci numbers? I can find no verification of this and would like to see some before we change the page entirely to reflect this idea. -- Antaeus Feldspar 21:08, 3 Feb 2005 (UTC)
- Big-endian just means that the bits are arranged in least-to-most significant order. Little-endian means that they are sorted most-to-least. Given the description of the code here, I would assume that big-endian is the only possibility. Ravenswood 21:39, 28 Apr 2005 (UTC)
- Well, the "big-endian" system described is not actually impossible, but a) 1 cannot be encoded in it, since there is no leading "10" to remove, and b) it seems an unnecessary complication for no reward. -- Antaeus Feldspar 22:23, 28 Apr 2005 (UTC)
Ooph
How about this:
To find the Fibonacci code for a number x, start with the code for x-1 and remove the 011 at the end. Assuming the resulting number to be little-endian, add 1 repeatedly until the result does not include the sequence "11". If the result exceeds the number of digits in the previous result, start over with that number of zeroes plus one.
Of course it could be written better, but there's my idea :-) --67.172.99.160 23:53, 25 August 2005 (UTC)