[Tutor] a puzzle about -3**2 vs (-3)**2
D Wyatt
fiberfolly at gmail.com
Fri Jul 31 19:20:50 CEST 2015
<snip>
>
> This matches the precedence rules for written mathematics, where negation
> has a lower precedence than exponentiation as well. So python is doing the
> correct thing here mathematically. See, for example,
> http://mathforum.org/library/drmath/view/53194.html
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
That is just so counterintuitive, and I've never run into this in any
mathematics I have taken. Now I'm going to have to research this
further, from a mathematics standpoint.
--
Deb Wyatt in WA
More information about the Tutor
mailing list