> Le 14 oct. 2016 à 16:52, Rick Waldron <waldron.r...@gmail.com> a écrit :
> 
> Python is also inconsistent: 
> 
> >>> pow(-2, 2)
> 4
> >>> -2 ** 2
> -4
> >>>

This is not inconsistency, but that follows from operator precedence rules 
(those used in mathematics, not in C).

In the same vein, you have `pow(1+1, 2) == 4` but `1+1 ** 2 == 2`, because the 
latter is interpreted as `1+(1 ** 2)`.

—Claude

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to