|
![](/i/fill.gif) |
In article <3bb37e54$1@news.povray.org> , "Thorsten Froehlich"
<tho### [at] trf de> 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] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |