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

Might be useful if it was stated at the start of the post exactly what the ^ operator is supposed to do - it does different things in different programming languages.


In context, I think it’s pretty clear that it’s exponentiation. Mostly because the context is math where the meaning is a lot more unambiguous.


I always felt the Fortran exponentiation operator (* *), which is inherited by javascript and php, was more intuitive notation.


Interesting, the caret looks better to my eyes, since the real notation is x², thus x^2 is pointing at where the 2 should be.

But I get the reading of double-asterisk as 'multiplication of multiplication' as well, either is fairly transparent really.


Indeed. To me C's ^ as xor has always been the weird one since it actually looks like a logical and: https://en.m.wikipedia.org/wiki/List_of_logic_symbols




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

Search: