Zeckendorf arithmetic

From Rosetta Code
Revision as of 12:41, 29 October 2012 by Nigel Galloway (talk | contribs) (Created page with "{{draft task}} Zeckendorf number representation is described [http://rosettacode.org/wiki/Zeckendorf_number_representation Here]. It looks like binary. The purpose of this tas...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Zeckendorf arithmetic is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Zeckendorf number representation is described Here. It looks like binary. The purpose of this task is to explore why Babbage et al. may have preferred binary to zeckendorf when designing computers. Here I extended that task by adding an increment and comparison operator. This task will implement addition; subtraction; multiplication; and division using zeckendorf.

Addition.

Like binary 1 + 1 = 10, note carry 1 left. There the similarity ends. 10 + 10 = 101, note carry 1 left and 1 right. 100 + 100 = 1001, note carry 1 left and 2 right, this is the general case.

Occurances of 11 must be changed to 100. Ocurances of 111 may be changed from the right by replacing 11 with 100, or from the left converting 111 to 100 + 100;

Subtraction.

To be completed.

Multiplication.

To be completed.

Division.

To be completed.