[docs] (no subject)

Akanksha Singh 94singhakanksha at gmail.com
Tue Oct 20 15:26:45 CEST 2015


Thanks for clearing the doubt.

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


More information about the docs mailing list