[Python-Dev] Order of operations

Alexandre Vassalotti alexandre at peadrop.com
Thu Aug 30 00:41:58 CEST 2007


On 8/29/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Scott Dial schrieb:
> > Martin v. Löwis wrote:
> >>> Do you know why? Thanks!
> >> I'm not sure why precedence was defined that
> >> way, though.
> >>
> >
> > Because it is consistent with C's precedence rules.
>
> Maybe I'm missing something - how exactly is the exponentiation
> operator spelled in C?
>

C doesn't have an exponentiation operator. You use the pow() function, instead:

  #include <math.h>
  double pow(double x, double y);

-- Alexandre


More information about the Python-Dev mailing list