The cmath module shown in Example 1-61 contains a number of mathematical operations for complex numbers.
Example 1-61. Using the cmath Module
File: cmath-example-1.py import cmath print "pi", "=>", cmath.pi print "sqrt(-1)", "=>", cmath.sqrt(-1) pi => 3.14159265359 sqrt(-1) => 1j
See the Python Library Reference for a full list of functions.
Core Modules
More Standard Modules
Threads and Processes
Data Representation
File Formats
Mail and News Message Processing
Network Protocols
Internationalization
Multimedia Modules
Data Storage
Tools and Utilities
Platform-Specific Modules
Implementation Support Modules
Other Modules