Why pow(-1, 0) returns 1 instead of -1? -


as google suggests -10=-1. , understand pow() function in javascript, python , c should return same result. it's not true. why?

python:

>>> pow(-1, 0) 1 

it's precedence thing. google thinks (-1)0 = 1, python:

>>> (-1)**0 1 

any nonzero number raised exponent 0 1.


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -