Zigzag Integer Encoder Encode integers with the zigzag mapping: n≥0 → 2n, n<0 → −2n−1. Description Encode integers with the zigzag mapping: n≥0 → 2n, n<0 → −2n−1.