On Friday 05 December 2014 19:09:29 andy pugh did opine
And Gene did reply:
> 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.
TBT I didn't test it at .001 offsets, so you are probably correct.
OTOH I am carving wood, at the instant with a dull mill so the result is a
bit "furry" when the wood is a white pine test piece that will be frewood
when I'm done, but its slow enough that the extra loop at the same depth
wastes about 2 minutes I'd druther not waste. I suppose I could set fudge
var at the top of a dummy test loop, and divide the fudge with a *
0.50000000 every pass thru the main loop to see where the actual error
shows up. The mul is probably 5x faster than a software divide.
> 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
What code generator uses that syntax? Or is WEND an alias for ENDWHILE in
our interpretor now? :)
Thanks Andy.
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS
------------------------------------------------------------------------------
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