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:17:05 EDT (-0400)
  Re: Probably been asked... Why no power operator?  
From: Warp
Date: 15 Nov 2002 03:51:28
Message: <3dd4b590@news.povray.org>
TinCanMan <Tin### [at] hotmailcom> wrote:
> don't forget brackets supercede everything: hence 'BEDMAS'

> Brackets
> Exponents
> Divison*
> Multiplication*
> Addition**
> Subtraction**

> D&M,A&S are interchangeable of course, they are just in that order fo the
> mnemonic.

  Actually that list should be written so that it's clear that eg.
addition and substraction have the same precedence. Having the same
precendence is completely different from being contiguous in the precedence
list, but one having higher precedence than the other.
  The general rule is that when there is more than one operator with the
same precedence, they are evaluated from left to right. Operators with
different precedences are evaluated in decreasing order of precedence.
  This means that "2-3+4" evaluates to a different value depending on this
difference.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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