int main(char[][] args) { dout.writeLine(toString(1uL,1u)); assert( toString(12uL,1u).length == 12 ); } This produces: 1000000000000000000000000000000000000000000000000000000000000000000000 Error: Assert Failure example(4) When I think it should produce 1