EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: Not-a-number (nan) issues
From: Andrew Johnson <[email protected]>
To: Kay-Uwe Kasemir <[email protected]>
Cc: "'EPICS Tech Talk'" <[email protected]>
Date: Fri, 08 Oct 2004 16:54:51 -0500
The behaviour of the aoRecord as reported is obviously highly undesirable,
so I'm looking at fixing that. We already have the IVOA and IVOV fields
that can be used to tell the record what to do when it has an undefined
value, and I intend to make use of this mechanism to control what happens when a NaN value is discovered.


For those interested, my solution is basically that instead of setting prec->udf to FALSE, it should be set to isnan(prec->val). The line where udf actually gets set may have to move around a little in some cases, but the idea is basically to ensure that anytime VAL is NaN that UDF gets set, so the record will go into a UDF/INVALID alarm state.

I'll be applying this fix to the other standard record types that have a VAL field of type DBF_DOUBLE. It doesn't make sense for the array record types though, and the digital and long types don't need to worry about NaN values anyway.

As far as the handling of NaNs elsewhere, Eric provided some information about how the different platforms C libraries cope - on Unix it is already possible to use "NaN" in your .db files (and probably in .dbd files too). There will be some more checking and additional work needed for handling NaNs in the numeric type conversions though. I personally think NaN should be made as full a citizen as it reasonably can be, so I would definitely vote against changing the behaviour of CA, following the principle of least surprise - apparently it works at the moment, so don't break it!

Eric is working on an epicsStrtod() routine to make string input conversions work everywhere, but we can't expect to be able to fix everything until the platform's C libraries cooperate.

- Andrew
--
Dear God, I didn't think orange went with purple until I saw
the sunset you made last night.  That was really cool. - Caro



Replies:
RE: Not-a-number (nan) issues Lawrence T. Hoff
References:
RE: Not-a-number (nan) issues Jeff Hill
Re: Not-a-number (nan) issues Kay-Uwe Kasemir

Navigate by Date:
Prev: Re: Not-a-number (nan) issues Till Straumann
Next: RE: double defenition in Epics Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Not-a-number (nan) issues Till Straumann
Next: RE: Not-a-number (nan) issues Lawrence T. Hoff
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·