Nicolas Alvarez wrote:
> The problem with doing #declare V=V+1/100; is that it might not reach 1.0000
> exactly at the end of the loop (because of floating point inaccuracies), so
> it might run one time too many.
>
Right. If you MUST use floats, more robust is this sort of thing:
#local xmin = ....;
#local xmax = ....;
#local dx = .....;
#local x = xmin;
#while (x < xmax + dx / 2)
#local x = x + dx;
#end
Post a reply to this message
|