Drift might be a problem but due to many significant digits almost certainly 
more of an annoyance than a real problem.

There is however a fundamental difference between ordinary integers or 
intepreted as a fixed decimal point and ordinay floating point numbers. For 
fixed point some of the lower digits are treated as decimal points though I 
never have seen it the other direction will of course also work, for 
addition/subtraction there will be no drift. For floating point a number of 
bits are used for the number while the others except one bit I think is used 
for sign is used to place decimal point. Floating point may store a very large 
range of numbers so are usually simpler to use, resolution is higher around 
zero, in particular some integer values are missing for large enough numbers as 
number of significant numbers are constant.

Do not think you have any reason to care about drift of absolute value or 
square root except then you compare numbers as they usually do not make a 
perfect fit. Ideally sqrt(x^2)=x but then using floating point there is a small 
difference, or you do nuclear fission and count part of an atom?


Den Lördag, Juli 03, 2021 09:32 CEST, skrev Alec Ari via Emc-developers 
<emc-developers@lists.sourceforge.net>:
 Hello,

Just curious, how would LinuxCNC detect a lack of precision in floating point? 
There are trivial x86_64 specific math instructions which would probably be 
faster than what LinuxCNC has used since the beginning but if these 
instructions happened to be off by a few decimals somewhere, how would you 
know? Would LinuxCNC throw a fault or would the machine just drift further and 
further away from where it's supposed to be or what?

The functions in question are:

https://git.musl-libc.org/cgit/musl/tree/src/math/x86_64/fabs.c

and

https://git.musl-libc.org/cgit/musl/tree/src/math/x86_64/sqrt.c

Thanks!

Alec


_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


 

_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to