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

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -