POV-Ray : Newsgroups : povray.general : Re: Probably been asked... Why no power operator? : Re: Probably been asked... Why no power operator? Server Time
5 Aug 2024 12:16:11 EDT (-0400)
  Re: Probably been asked... Why no power operator?  
From: Christopher James Huff
Date: 14 Nov 2002 15:54:37
Message: <chrishuff-B70261.15540814112002@netplex.aussie.org>
In article <3dd3cb3c$1@news.povray.org>, "Slime" <slm### [at] slimelandcom> 
wrote:

> Well, to say there's no mathematical reason doesn't seem entirely correct.
> Most everyone is taught that exponentiation comes before negation in an
> early algebra class. It's the way we've been taught to think.

Um, no. In algebra, there is no precedence, the exponent is in 
superscript, so there is no ambiguity. A plain text programming language 
doesn't have this, an operator has to be used, so it has to pick a 
precedence. I don't know what you were taught...


> Besides, I would think that since we're adding ^ as a new operator, we could
> give it whatever precedence we wanted, and it just seems more logical to me
> to make it work the way we've been taught it should work than to allow the
> 2^-3 syntax just for convenience.

Not for convenience, for self consistency. There isn't an existing rule, 
so the one that was most logical and consistent was chosen.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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