← back to index

Wasthon — cmath vs hand-rolled Pure-Python

Note: Brython does not ship a working cmath module — its bundled Lib/cmath.py is broken at import time. Without Wasthon, the only option for a Brython user needing complex math is to inline a pure-Python translation themselves (a few hundred lines of hypot/sqrt/atan2 dance). That's what the "Pure-Python" column measures. Wasthon's cmath is therefore the only working complex math available to Brython today; any speedup over Pure-Python is bonus on top of providing the module at all.

OperationWasthon msPure-Python ms Speedup

Log