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

  > I would have an exponentiation operator.
  > That operator might be:  **
  > [...]
  > It might be possible to add this to existing C now
  > since the operator is not already used.

  a ** b == a * (*b)


As I recall, a C compiler is not required to realize that

  a -- b
would be valid if parsed as

  a - (- b)
so creating this operator would be equally feasible. Though I don't think exponentiation is common enough to need one, especially in C where you couldn't overload it for rationals or bignums.


The point is that

    a**b
may occur in existing code, and mean

    a * (*b)
Introducing a double-star operator would break this code.




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

Search: