Title: Theory / Unimportant / CS / Algo / Hacker's delight{ / 12 Unusual bases / Base -1+i;
Tags: fromAlgorithm hasNotNewEffectReturnsMeaning

Name: A complex integer
Definition: A number of the form \(n+im\) with \(i=\sqrt{-1}\), \(n,m\in\mathbb Z\)
Page: 230
Chapter: 12
Section: 2

Question: The remainder of the division of \(a+ib\) by \(-1+i\)
Answer: equals \(a+b\equiv0\mod 2\)
Page: 230
Chapter: 12
Section: 2
Variables: \(a+ib\) a complex integer

Page: 230
Implementation: Recursively:
if \(a=b=0\), the empty string
Otherwise, the first bit is the remaining \(r\) of the division of \(a+ib\) by \(-1+i\)
Followed by the representation of \((a+bi-r)(-1-i)/2\)
Section: 2
Chapter: 12
Effect: Its representation in basis \(-1+i\)
Variables: \(a+ib\) a complex integer