TonyB wrote:
> Hello. I am having a small math problem. All my life I have found this
> to be true. I even tried it on paper, and it works.
> A/2 + B/2 = (A + B)/2
Yes.
> Am I wrong? The reason I ask is because of something that happened to me
> while playing with Jaime Vives' clouds. The line that reads:
> #declare p=sky_color*.5+White*.5;
#declare p=(sky_color*.5)+(White*.5)
> *can* be re-written as:
> #declare p=(sky_color+White)/2;
> right?
As I wrote it, yes.
I have not tested it but interpretors and compilers and parsers
have their rules of evalution of operators such as * a +. *
should come before + as you assumed. Your first version may be
confusing the POV parser. BUT any well behaved software ALWAYS
obeys parenthesises. When in doubt, use them.
They are well behaved becaues their noses get rubbed in it if
they do not obey parenthesises.
BTW: Has anyone identified the parser used and where to find the
specs for it?
Post a reply to this message
|