Half the time the result is off by one.

did not encounter that but you probably have more long long experience as I have.

Added a patch for (unsigned) long long in print.cpp some time ago.

print.h

#ifdef SUPPORT_LONGLONG

size_t println(int64_t, int = DEC);

size_t print(int64_t, int = DEC);

size_t println(uint64_t, int = DEC);

size_t print(uint64_t, int = DEC);

#endif

print.cpp

#ifdef SUPPORT_LONGLONG

size_t Print::println(int64_t number, int base)

{

size_t n = 0;

n += print(number, base);

n += println();

return n;

}

size_t Print::print(int64_t number, int base)

{

size_t n = 0;

if (number < 0)

{

write('-');

number = -number;

n++;

}

n += print((uint64_t)number, base);

return n;

}

size_t Print::println(uint64_t number, int base)

{

size_t n = 0;

n += print((uint64_t)number, base);

n += println();

return n;

}

size_t Print::print(uint64_t number, int base)

{

size_t n = 0;

unsigned char buf[64];

uint8_t i = 0;

if (number == 0)

{

n += print((char)'0');

return n;

}

if (base < 2) base = 2;

else if (base > 16) base = 16;

while (number > 0)

{

uint64_t q = number/base;

buf[i++] = number - q*base;

number = q;

}

for (; i > 0; i--)

n += write((char) (buf[i - 1] < 10 ?

'0' + buf[i - 1] :

'A' + buf[i - 1] - 10));

return n;

}

#endif