示例#1
0
 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):
     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'
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
文件: arrayprint.py 项目: 87/numpy
 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 __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)
示例#7
0
 def formatter(x):
     r = format_longfloat(x.real, precision)
     i = format_longfloat(x.imag, precision)
     return '%s+%sj' % (r, i)
示例#8
0
 def formatter(x):
     r = format_longfloat(x.real, precision)
     i = format_longfloat(x.imag, precision)
     return '%s+%sj' % (r, i)
示例#9
0
 def formatter(x):
     return format_longfloat(x, precision)
示例#10
0
 def formatter(x):
     return format_longfloat(x, precision)