Search notes:

Python library math vs cmath

The math module consists mostly of thin wrappers around the platform C math library functions.
cmath provides a similar, but not identical, selection of functions which always return complex numbers (but constants such as e, pi or tau are floats):
>>> import cmath
>>> cmath.sqrt(4)
(2+0j)
>>> cmath.e
2.718281828459045
With math, sqrt(-1) raises ValueError while cmath returns i (1j) for this expression.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1745042927, '13.58.196.90', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Python/standard-library/math/vs-cmath(42): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78