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
Comments
Post a Comment