Negafibonacci coding: Difference between revisions

Content deleted Content added
needs refs
SmackBot (talk | contribs)
m Date maintenance tags and general fixes
Line 1:
{{Unreferenced|date=September 2009}}
{{unreferenced}}
{{cleanupCleanup|date=January 2009}}
{{numeral systems}}
In [[mathematics]], '''negaFibonacci coding''' is a [[universal code (data compression)|universal code]] which encodes integers into binary [[code word]]s. It is similar to [[Fibonacci coding]], except that it allows both positive and negative integers to be represented. All codes end with "11" and have no "11" before the end. The code for the integers from -11 to 11 is given below.
 
 
xx negaFibonacci representation negaFibonacci code
Line 29 ⟶ 28:
10 1001000 00010011
11 1001001 10010011
 
 
The Fibonacci code is closely related to ''negaFibonacci representation'', a positional [[numeral system]] sometimes used by mathematicians. The negaFibonacci code for a particular integer is exactly that of the integer's negaFibonacci representation, except with the order of its digits reversed and an additional "1" appended to the end. The negaFibonacci code for all negative numbers has an odd
number of digits, while those of all positive numbers have an even number of digits.
 
 
 
To encode an integer ''X'':
Line 50 ⟶ 46:
{{Compression Methods}}
 
{{DEFAULTSORT:Negafibonacci Coding}}
[[Category:Non-standard positional numeral systems]]
[[Category:Lossless compression algorithms]]