Back
I just want to know, What's the difference between x**(1/2), cmath.sqrt(), and math.sqrt()?
In the event that you take a gander at the documentation for cmath and math separately, you will find that:
cmath "provides access to mathematical functions for complex numbers"math "functions cannot be used with complex numbers; use the functions of the same name from the cmath module if you require support for complex numbers."The (**) operator maps to the pow function, with the important difference that pow converts its arguments to float.
Want to learn python to get expertise in the concepts of python? Join python certification course and get certified
31k questions
32.8k answers
501 comments
693 users