POV-Ray : Newsgroups : povray.general : Problems with iterations : Re: Problems with iterations Server Time
31 Jul 2024 02:23:06 EDT (-0400)
  Re: Problems with iterations  
From: Nicolas Alvarez
Date: 10 Jan 2008 16:17:35
Message: <47868b6f$1@news.povray.org>

> I'm wondering if simply changing the condition to "i < 0.999999" is sufficient.
> The likelihood of the variable falling outside this range is pretty slim. Also,
> to how many decimal places does POV-Ray calculate? I thought the "system
> specific" option in the "str" function returned values using this amount.

"To how many decimal places does POV-Ray calculate" is the wrong 
question to ask. POV-Ray asks your CPU to do floating-point 
calculations, that's all. POV-Ray doesn't do numerical calculations in 
any different way than the rest of your computer.

Also, floating-point numbers don't even work in terms of "decimal places".

Use this:

#local i = 0;
#local numerator = 1;
#local divisor = 6;
#while(i < divisor)
  #local x = i*numerator/divisor;
  #debug concat("x = ", str(x, 0, -1),"\n")
  #local i = i + 1;
#end

and be done with it.


Post a reply to this message

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