1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: FLOOR function in EPICS CALC error |
From: | <[email protected]> |
To: | <[email protected]> |
Cc: | [email protected] |
Date: | Mon, 14 Nov 2016 10:45:49 +0000 |
Thank you Mark and Tim, I understand what is happening now, I should have checked the precision set on PREC to see this correctly. With the correct PREC, I see the irrational part now. Thank you for your time, Rory From: Engbretson,
Mark S. [mailto:[email protected]] I.e. 0.01 is a endlessly ongoing bit string in base 2. The number can not be represented without lose on a binary computer.
Wouldn't an easier test of FLOOR be just to use the floor statement with a constant? If it was really broken, order of parens should make little different. since it does, it seems as if the actual value of the calculation is suffering from
a precision issue.
Hi, I am seeing what I think may be a rounding error in the FLOOR function and I was wondering if others had seen this. I replaced the variables in my code with actual values to reproduce the problem. I am using EPICS R3.14.12.5 with Scientific
Linux 7. I also tried it with the same version of EPICS running on Linux Mint In Calc records, just using an empty Calc record and putting the values in by hand: record(calc,"DLY:FSTEP") { field(CALC,"6.1-0.2/0.01") } 6.1-0.2/0.01 gives 590 as it should However: FLOOR((6.1-0.2)/0.01) Gives me 589 If I write it as follows: FLOOR((6.1-0.2)*(1/0.01)) I again get 590 (as it should be) I wondered if this was my install or if this has been seen before. It only seems to happen for random values. Best regards, Rory Clarke |