[][src]Function number2name::signed2unsigned

pub fn signed2unsigned(number: i64) -> u64

Map a signed integer to an unsigned one, in a way that

  • is bijective (reversible).
  • preserves absolute value order.
  • Puts -x right before +x (necessary because there is one more negative number). Example: -3 -> 5 -2 -> 3 -1 -> 1 0 -> 0 +1 -> 2 +2 -> 4 +3 -> 6 +4 -> 8