On 5 December 2014 at 23:54, Gene Heskett <[email protected]> wrote:
> In building a while loop that dealt with values the that start as plus and
> went negative as the loop execs, I found I had to subtract 0.01000 from
> the var I as testing against to stop a last, unwanted loop from being
> executed.  All my vars are stated to about 8 digits.

That seems strange, as that seems like a large delta if you use that
many digits.

Floating point does have a tendency to hold numbers almost, but not quite, zero.

My loops tend to look like

O100 WHILE (#1 GT #2 + #<cut>)
  #1 = [#1 - #<cut>]
  G1 Z#1
  {Cuts}
WEND
G1 Z#2
{Repeat of cuts at exact depth}


For a complex cut a better way is this, though with a risk of a really
small last cut (the above way may give a slightly deep last cut, but
both explicitly finish at exact depth)


O100 WHILE (#1 GT #2)
    #1 = [#1 = #<cut>]
   O101  IF [#1 LT  #2]
       #1 = #2
   O101 ENDIF
   {Cuts}
WEND



-- 
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to