POV-Ray : Newsgroups : povray.general : Why does POV always evaluate both expressions with a '&'? : Re: Why does POV always evaluate both expressions with a '&'? Server Time
7 Aug 2024 17:26:25 EDT (-0400)
  Re: Why does POV always evaluate both expressions with a '&'?  
From: Thorsten Froehlich
Date: 27 Sep 2001 15:43:39
Message: <3bb3816b@news.povray.org>
In article <3bb37e54$1@news.povray.org> , "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> By using the original search direction and a third variable it might well be
> that there is a more efficient solution so parsing is faster if the above is
> done on huge arrays with only a very few zeros.

Actually, the code below should work (didn't bother to test it) and be much
faster in most cases.

#macro findzero(a, n)
 #local i = 0;
 #while(i <= n)
  #if(a[i] != 0)
   #declare n = i;
  #end
  #declare i = i + 1;
 #end
#end

    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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