Bizarre arithmetic results
Christian Heimes
lists at cheimes.de
Thu Feb 11 07:33:37 EST 2010
More information about the Python-list mailing list
Thu Feb 11 07:33:37 EST 2010
- Previous message (by thread): Bizarre arithmetic results
- Next message (by thread): Bizarre arithmetic results
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Terrence Cole wrote: >>>> -0.1 ** 0.1 > -0.7943282347242815 >>>> a = -0.1; b = 0.1 >>>> a ** b > (0.7554510437117542+0.2454609236416552j) >>>> -abs(a ** b) > -0.7943282347242815 > > Why does the literal version return the signed magnitude and the > variable version return a complex? The binary power operator has a higher precedence than the unary negative operator. -0.1 ** 0.1 is equal to -(0.1**0.1) Christian
- Previous message (by thread): Bizarre arithmetic results
- Next message (by thread): Bizarre arithmetic results
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list