This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JohnSmith11132
Recipients JohnSmith11132
Date 2020-11-21.19:56:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605988612.3.0.228167402053.issue42428@roundup.psfhosted.org>
In-reply-to
Content
Basically when squaring as a negative number, if it's a variable it acts like -3*-3 otherwise it acts like 3*-3.
For example:
>>> x = -3
>>> x ** 2
9
>>> -3 ** 2
-9

pow(-3, 2) seems to act like -3 * -3?
** 3 seems fine and both seems to act like -3*-3*-3.
>>> x = -3
>>> x ** 3
27
>>> -3 ** 3
-27

Will it be safe to use the ** 2 in Python? If I use a variable will it return the same value?

I only found this for the bug:
https://devforum.roblox.com/t/inconsistent-squaring-behavior/820028/

It looks like the exact same issue I'm having, but I still don't get it and it's not for Python.
History
Date User Action Args
2020-11-21 19:56:52JohnSmith11132setrecipients: + JohnSmith11132
2020-11-21 19:56:52JohnSmith11132setmessageid: <1605988612.3.0.228167402053.issue42428@roundup.psfhosted.org>
2020-11-21 19:56:52JohnSmith11132linkissue42428 messages
2020-11-21 19:56:52JohnSmith11132create