Question

I want to know why does this code in Python

print gmpy.sqrt(2009)

give the result 44, and not 44.82186966... like i want it to do? How can i set the function to show me the decimal numbers.

Thank you in advance.

Was it helpful?

Solution

Bluntly put, because it was defined that way. There is no way to set that option.

Edit: @casevh is correct: gmpy2.sqrt() returns what you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top