EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: NaN and analog records
From: Goetz Pfeiffer <[email protected]>
To: EPICS tech-talk <[email protected]>
Date: Tue, 4 Nov 2014 14:10:36 +0100
Hi Ralph,

comparisions between NaN and other numbers are not undefined,

here:

http://www.gnu.org/software/libc/manual/html_node/Infinity-and-NaN.html

or

http://stackoverflow.com/questions/1565164/what-is-the-rationale-for-all-comparisons-returning-false-for-ieee754-nan-values

are some remarks on this, quote (from Stackoverflow):

Clause 5.11, paragraph 2 of the 754-2008 standard:

Four mutually exclusive relations are possible: less than, equal, greater than, and unordered. The last case arises when at least one operand is NaN. Every NaN shall compare unordered with everything, including itself.
How DRVL and DRVH behave is a matter of interpretation. If they are meant to ensure that

DRVL <= value <= DRVH

than it should not be possible to have value==NaN since this is a contradiction to both relations above.

If they are meant like this:

if DRVL > value:
    value= DRVL
if DRVH < value:
    value= DRVH

then the record would work as expected, as for NaN both conditions are false.

Personally I would have expected the first variant.

The possibility to enter "NaN" in panels is at least unexpected. I wonder what would happen at many EPICS installations if the operator would take every single entry field and enter "NaN". I currently wouldn't dare to do this at our facility... ;-)

Greetings

  Goetz Pfeiffer


On 11/04/2014 01:41 PM, Ralph Lange wrote:
Hello Götz,

On 04/11/2014 13:32, Goetz Pfeiffer wrote:
another problem is that DRVL and DRVH seem to be ignored for NaN.

The following record;

record(ao,"UE56ID3R:BaseParGapTrs") {
     field(ASG,"USERCTL")
     field(DRVH,"0.1")
     field(DRVL,"0")
     field(LINR,"NO CONVERSION")
     field(OIF,"Full")
     field(PREC,"4")
}

for example can be set to NaN (at least for Epics Base 3.14.8).

Comparisons between numbers and non-numbers (such as NaN) are undefined.
What is your suggestion on how to check limits for a non-number without using comparisons?

We also found that you can type "NaN" at any entry field in DM2K which
writes NaN directly to the PV.

NaN, -inf and +inf are valid values for a double. Why would you reject entering valid values in entry fields?

Cheers,
~Ralph


Attachment: signature.asc
Description: OpenPGP digital signature


References:
NaN and analog records Benjamin Franksen
Re: NaN and analog records Goetz Pfeiffer
Re: NaN and analog records Ralph Lange

Navigate by Date:
Prev: Re: compiling issues during building cothread Benjamin Franksen
Next: Re: NaN and analog records Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: NaN and analog records Ralph Lange
Next: Re: NaN and analog records Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·