Pow operator precedence

Grue Grue at nop.com
Fri Jan 13 11:24:14 PST 2012


    The logic is that the precedence in the language matches the
    precedence of a written equation.



  But the operator looks nothing like the written equation... nothing at all like the written equation.
  Perhaps D could support the unicode characters '²' '³' or 'ª' as kinda handy operators. But to me, the operator looks NOTHING like maths notation, and it would never have occurred to me that the operator was trying to emulate maths notation (and by extension, its precedence rules).
  I'd be interested to see a poll, and how many people see it one way or the other...

Beware... your statement has awoken an "Ancient Forum Lurker"! ;)

1. Google -5^2, result: -(5^2) = -25
2. Start ancient TI graphing calculator(which by the way has a special unary (-) minus operator).
-5^2 = -25
-5² = -25

The list can be extended by a great number of examples of prior convention for the pow operator(especially in mathemathical software)... not just Python... I have actually never even seen a valid counter example... changing this would greatly confuse people with mathematical background.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120113/e9ee2d7d/attachment.html>


More information about the Digitalmars-d mailing list