POV-Ray : Newsgroups : povray.beta-test : Small bug, asking for someone to check on latest RC : Re: Small bug, asking for someone to check on latest RC Server Time
29 Jul 2024 10:29:19 EDT (-0400)
  Re: Small bug, asking for someone to check on latest RC  
From: Josh Seagoe
Date: 28 May 2002 23:46:55
Message: <3CF451DD.5060806@smileyface.com>
Wolfgang Thaller wrote:
> "Thorsten Froehlich" <tho### [at] trfde> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.