<p>Thanks for clearing the doubt.</p>
<p>On Oct 16, 2015 8:56 PM, "Zachary Ware" <<a href="mailto:zachary.ware%2Bpydocs@gmail.com">zachary.ware+pydocs@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> On Wed, Oct 14, 2015 at 1:14 PM, Akanksha Singh<br>
> <<a href="mailto:94singhakanksha@gmail.com">94singhakanksha@gmail.com</a>> wrote:<br>
> > -2**4 gives answer -16 which should be positive ie ans=16.<br>
><br>
> This is not the correct place to report behavioral bugs; this list is<br>
> for discussion of the Python documentation (including bug reports<br>
> about the docs).  Better would be either a post to python-list<br>
> (<a href="mailto:python-list@python.org">python-list@python.org</a>) or a bug report on <a href="http://bugs.python.org">bugs.python.org</a>.<br>
><br>
> However, in this case, there is no bug.  You're running into a common<br>
> misconception with operator precedence.  `-2**4` is evaluated as<br>
> `-(2**4)`, that is, "the negation of 2 to the power of 4."  To get<br>
> "the 4th power of negative 2", you'd need to do `(-2)**4`.  See<br>
> <a href="https://docs.python.org/3/reference/expressions.html#operator-precedence">https://docs.python.org/3/reference/expressions.html#operator-precedence</a><br>
> for more information.<br>
><br>
> Hope this helps,<br>
> --<br>
> Zach<br>
</p>