On 3/4/2011 8:31 AM, Igor Chudov wrote:
> On Fri, Mar 4, 2011 at 7:27 AM, Przemek Klosowski<
> przemek.klosow...@gmail.com>  wrote:
>
>> On 3/4/11, Igor Chudov<ichu...@gmail.com>  wrote:
>>
>>> I re-wrote Andy's function to compare the absolute value of the diff, and
>>> compare that to 1E-07. I know that this is crazy, ugly, and stupid. But
>> it
>>> works beautifully.
>> NO, absolutely not stupid at all. This is in fact the only sane way of
>> comparing floating point numbers, recommended in all numerical
>> analysis textbooks.
>>
>>
> Whils I kind of agree in general (I do numerical modeling too, for a
> living), here we are essentially comparing a == a and it fails. See my
> another post in this thread about GCC bug 323.
>
> My concern with doing what I am doing, is that if I wanted the knee to move
> at glacial speed, it would shut off.
> But I know that I do not need it.

Congratulations, Igor, on getting your mill up and running with EMC2. I 
tip my hat to you.

As a sidebar comment, though, I can't help but pick a nit with this 
notion that we are "essentially comparing a==a," which to me carries the 
implication that there must be something wrong.

What we are actually doing is comparing (whatever that means) the 
contents (whatever that means) of two different storage locations 
(whatever that means). That you believe the contents should the same is 
based on assumptions about how the underlying machine code generates, 
stores, and retrieves those contents.

When I look up GCC bug 323, I see that it was closed 10 years ago with 
the statement:

      See any faq on numerical analysis that mentions the x86.
      You are seeing the results of excess precision in the FPU.
      Either change the rounding precision in the FPCR, or work
      around the problem with -ffloat-store.

Changing your code as you did "essentially" changed the rounding precision.

As far back as the 1980s, when we were formalizing IGES, the first CAD 
data-interchange standard, we included a requirement that the sending 
system tell the receiving system the exchange-file tolerance, e.g., how 
much two points could differ and still be considered equal. Without that 
information, perfectly good CAD systems receiving the data often blew up 
on models that worked beautifully in the sending CAD system. Thirty 
years on, the same old bugaboo still catches people out, and not just 
with CAD data. Equality and identity are slippery concepts in computing.

But this is just a nit. Have fun making chips fly!

Regards,
Kent

PS - I loved seeing the energy of your son in the video you posted. I'm 
old enough to have grandkids older than he in whom I'm now trying to 
instill a sense of excitement and satisfaction in making real things work.


------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to