def float_format(x): """ Format an integer: - upcast to a double - use snprintf - resize buffer according to # of bytes written """ return formatting.format_static("%f", upcast(x), 20)
def __str__(self): # maxlen = int(math.log10(2**64)) + 1 = 20 in a 64-bit address space return formatting.format_static("%p", self, 20 + 1)