Skip to content

NegativeNumerals ​

Base −b-b: digits 0,…,b−10,\dots,b-1 again, but the place values alternate sign, so every integer — negatives included — has exactly one representation and there is no sign bit.

NegativeNumerals(b)the system, base −b-b
Typed signatures
TypePackageApplies
(integer) -> valuenumeralsalways

Domain: Numeral systems

Examples

Basic #

−6=−8+4−2-6 = -8 + 4 - 2: no sign needed

live ↗
InIntegerDigits(−6,NegativeNumerals(2))\mathrm{IntegerDigits}(-6, \mathrm{NegativeNumerals}(2))Out[1,1,1,0]\bigl\lbrack1, 1, 1, 0\bigr\rbrack
About
Examples1

See also: IntegerDigits, BalancedNumerals, NegativeRadix