Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Any idea why they appear to prefer `cmath.pi` and `cmath.e` rather than `math.pi` and `math.e`?


[deleted]


While that convention is generally true, in this case the c in cmath refers to complex numbers.


rom is correct, both the math and cmath modules are implemented in C. And even if the math module was pure Python I don't think that the speed of accessing a constant would be drastically different.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: