|
![](/i/fill.gif) |
Wolfgang Thaller wrote:
> "Thorsten Froehlich" <tho### [at] trf de> wrote:
>
>>It works as it should and exactly like in all other programming languages
>>where the unary operators also have higher precedence than all other
>>operators.
> Let me give a few counter examples:
>
> Mathematica, Matlab, Haskell, my TI-92+ calculator. I don't currently have
> access to any other programming languages that support a power operator.
MS QBasic, anchient copy of Derive, TI-86 calculator
(tho the last two are a bit predictable, considering that a TI-92
probably uses a newer version of Derive)
I don't know of a single language that has exponentation with a lower
precedence than unary minus.
> If the first expression was actually legal, then both expressions would
x+++---y is legal: (x++)+(-(--y))
> Unary minus should have the about same precedence as binary minus, IMHO.
> Any deviation from this "mathematical standard" (IMHO) without producing at
> least a warning message of some kind *could* be considered a "small bug" in
> pov-ray.
Unary minus should have the same precedence as it has in C: higher than
multiplication, but lower than some binary operators. (::, ->, ., and,
if C had it, exponentation)
But this is insanely easy to work around, so it's not very important.
-josh
Post a reply to this message
|
![](/i/fill.gif) |