On Thursday, January 26, 2012 12:59:48 AM Mark Cason did opine:

> On 01/25/2012 04:44 AM, gene heskett wrote:
> > Why not try (g)awk? You can search, match strings, and do some math
> > with it. Of course you could always use a combination of sed, awk and
> > bash, or simply perl.
> > I looked at the gawk man page, didn't see any mention of floating
> > point math so I kept on looking.  Bash only does integer.  Didn't see
> > any mention of sed&  math or floating point.
> 
>    BC is a precision calculator, that works in BASH, but it has a known
> rounding error, that caused me all kinds of problem.
> 
>    If you have perl, you can do floating point math like this:
> perl -e 'printf(STDOUT "%.3f\n", eval($Math_goes_here))';
> 
>    The %.3f is the precision, which can be run out to many multiple
> decimal places.  The \n is a newline command.  Without it, the output
> will be appended to the current line.
> 
>    It is easy to embed in other scripts with a variable in the eval()
> statement.  The precison can also be a variable.  I have many BASH
> scripts that use this same command.

Hmmm, silly Q for you and Rafael:  If, after having executed the G38.2 and 
the machine is stopped, what sort of havoc would I create if I simply wrote 
the known height of the gage at contact, into #5063?  That might not be the 
correct #number but you get the idea.  What ever number would cause the 
machine's currant Z, both as displayed and internally used to determine the 
next move, to be corrected to the known gage height it is actually sitting 
at IOW?

Using bc or perl seems like a gawd-awful kludge even if it did work.  
LinuxCNC has its own math functions that appear to my untrained eye to be 
spot on, so why not use them directly?

An old friend and engineer back in about 1960 was fond of the phrase 
'simplicate' and I'd think this qualifies.  :)

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene>
Take what you can use and let the rest go by.
                -- Ken Kesey

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to