Пример #1
0
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)
Пример #2
0
 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)
Пример #3
0
 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)