def formatter(x): r = format_longfloat(x.real, precision) i = format_longfloat(x.imag, precision) if x.imag < 0: i = '-' + i else: i = '+' + i return r + i + 'j'
def formatter(x): if isnan(x): return _nan_str elif isinf(x): if x > 0: return _inf_str else: return '-' + _inf_str return format_longfloat(x, precision)
def __call__(self, x): if isnan(x): if self.sign: return '+' + _nan_str else: return ' ' + _nan_str elif isinf(x): if x > 0: if self.sign: return '+' + _inf_str else: return ' ' + _inf_str else: return '-' + _inf_str elif x >= 0: if self.sign: return '+' + format_longfloat(x, self.precision) else: return ' ' + format_longfloat(x, self.precision) else: return format_longfloat(x, self.precision)
def formatter(x): r = format_longfloat(x.real, precision) i = format_longfloat(x.imag, precision) return '%s+%sj' % (r, i)
def formatter(x): return format_longfloat(x, precision)