POV-Ray : Newsgroups : povray.text.tutorials : Summing over indices of an array : Re: Summing over indices of an array Server Time
2 Mar 2024 11:24:04 EST (-0500)
  Re: Summing over indices of an array  
From: Christoph Hormann
Date: 22 Jan 2005 03:30:02
Message: <cst2rq$36v$1@chho.imagico.de>
Mike Williams wrote:
> I think you have to use a loop:

Bah, you surely don't have to:

#macro Add(i)
   #if (i>0)
     #local R=Add(i-1)+elem[i];
     #local R=elem[i];

#declare Sum=Add(n);



POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______

Post a reply to this message

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