Skip to main content

csd_digits

Function csd_digits 

Source
pub fn csd_digits(c: i64, width: u32) -> Vec<(u32, i64)>
Expand description

The canonical signed digits of c mod 2^width: (shift, ±1) pairs whose signed sum of powers of two is c, no two adjacent. The top digit is taken positive, since ±2^(width-1) agree mod 2^width.