implement negative integer encode