POV-Ray : Newsgroups : povray.bugreports : 3.8 macro parsing errors : Re: 3.8 macro parsing errors Server Time
27 Jul 2024 12:20:28 EDT (-0400)
  Re: 3.8 macro parsing errors  
From: Kelumden
Date: 21 Jun 2024 11:35:00
Message: <web.66759c8918d864b5587c26bf123015f7@news.povray.org>
> Also struggling a bit with
> result *= y++;
> I interpreted that as:
> #local Result = Result * (Y+1);
> (line 102)

The whole statement, when decomposed, can be interpreted in C/C++ as

      old_y = y ;
      y = y + 1 ;
      result = result * old_y ;

'y++' is interpreted as get the value of y, increment y by one then return the
value of y prior to incrementing it.

      #local Old_Y = Y ;
      #local Y = Y + 1 ;
      #local Result = Result * Old_Y ;

In your interpretation, Y will never be incremented ...


Post a reply to this message

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