Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's no regular engineering convention about the ^ exponentiation operator, because there is no exponentiation operator in regular or engineering math notation. The superscript used for exponentiation doesn't need a precedence level, it has a natural grouping behvaior.

This is most visible in the fact that you never need parentheses around an exponent expression in math notation, but you need them a lot in programming notation. They are just different notations.

Consider in math notation:

   2+2
  3    + 5
Programming notation:

  3^(2+2)+5
Completely different notations in a much more fundamental way than how they treat unary minus.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: