Floats and Complex Numbers

Floating Point

     a = 42.37
     b = -2.3477e+30
  • Represented as IEEE 754 64-bit double precision (the 'double' type in C).

Complex Numbers

     c = 4.6 + 5.2J
  • Represented as a pair of floating point numbers
  • Available attributes
     c.real           # Real component
     c.imag           # Imaginary component
<<< O'Reilly OSCON 2000, Introduction to Python, Slide 37
July 17, 2000, beazley@cs.uchicago.edu
>>>