Roots of unity: Difference between revisions
Content added Content deleted
m (→[[Roots_of_unity#Python]]: restructure) |
|||
Line 262: | Line 262: | ||
class Complex(complex): |
class Complex(complex): |
||
def __repr__(self): |
def __repr__(self): |
||
format_real = (" " if self.real > 0 else "") + "%6.4f" |
|||
format_imag = ("+" if self.imag > 0 else "") + "%6.4fj" |
|||
return ( |
return (format_real+format_imag) % (self.real, self.imag) |
||
for root in range(2, 10+1): |
for root in range(2, 10+1): |