Okay, so I'm fully well aware of how this is applied in C# and C. But I can't figure it out in Swift 3.
Is there an algorithm to convert n into negabinary base (-2).
7 = -3*-2 + 1 (least significant digit)
-3 = 2*-2 + 1
2 = -1*-2 + 0
-1 = 1*-2 + 1
1 = 0*-2 + 1 (most significant digit)