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: <[email protected]>
To: <[email protected]>, <[email protected]>
Date: Tue, 4 Nov 2014 13:37:33 +0000
From: Ralph Lange [mailto:[email protected]]
> Comparisons between numbers and non-numbers (such as NaN) are
> undefined.

Not quite: comparisons involving NaN are defined to always return false.  This means that a test of the form

	if (prec->drvl <= value && value <= prec->drvh)
	    // accept value
	else
	    // reject value

would have the desired effect (and setting a drv limit would cause all values to be rejected!)

> 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



Replies:
Re: NaN and analog records Dirk Zimoch
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: NaN and analog records Ralph Lange
Next: support for NIKHEF Hall probes Pierrick Hanlet
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 Benjamin Franksen
Next: Re: NaN and analog records Dirk Zimoch
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 ·