1 #!/usr/bin/env python 2 3 """ 4 Complex number objects. 5 6 Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk> 7 8 This program is free software; you can redistribute it and/or modify it under 9 the terms of the GNU General Public License as published by the Free Software 10 Foundation; either version 3 of the License, or (at your option) any later 11 version. 12 13 This program is distributed in the hope that it will be useful, but WITHOUT 14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 details. 17 18 You should have received a copy of the GNU General Public License along with 19 this program. If not, see <http://www.gnu.org/licenses/>. 20 """ 21 22 class complex: 23 24 "A complex number representation." 25 26 def __init__(self, real, imag=None): 27 self.real = real 28 self.imag = imag 29 30 def __iadd__(self, other): pass 31 def __isub__(self, other): pass 32 def __add__(self, other): pass 33 def __radd__(self, other): pass 34 def __sub__(self, other): pass 35 def __rsub__(self, other): pass 36 def __mul__(self, other): pass 37 def __rmul__(self, other): pass 38 def __div__(self, other): pass 39 def __rdiv__(self, other): pass 40 def __floordiv__(self, other): pass 41 def __rfloordiv__(self, other): pass 42 def __and__(self, other): pass 43 def __rand__(self, other): pass 44 def __or__(self, other): pass 45 def __ror__(self, other): pass 46 def __xor__(self, other): pass 47 def __rxor__(self, other): pass 48 def __lt__(self, other): pass 49 def __gt__(self, other): pass 50 def __le__(self, other): pass 51 def __ge__(self, other): pass 52 def __eq__(self, other): pass 53 def __ne__(self, other): pass 54 def __neg__(self): pass 55 def __pos__(self): pass 56 def __str__(self): pass 57 58 __repr__ = __str__ 59 60 def __bool__(self): 61 62 "Return a boolean interpretation of the number." 63 64 return self.real and self.imag 65 66 def conjugate(self): pass 67 68 # vim: tabstop=4 expandtab shiftwidth=4