POV-Ray : Newsgroups : povray.general : Macro problem : Re: Macro problem Server Time
29 Jul 2024 00:25:02 EDT (-0400)
  Re: Macro problem  
From: MichaelJF
Date: 11 Oct 2013 06:15:01
Message: <web.5257cef730eb22c6e83c0f490@news.povray.org>
Sorry again:

#declare Zufall=seed(317);

#macro randsign()
   #local Z1=rand(Zufall)-0.5;
   #if (Z1=0) #local Z1=0.1; #end     // avoid division by zero
   Z1/abs(Z1)
#end

#declare Count=0;
#while(Count<100)
   #declare ZufallsZahl=randsign();
   #debug concat("Zufallszahl: ",str(ZufallsZahl,8,4),"\n")
   #declare Count=Count+1;
#end


Post a reply to this message

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