EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  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  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: NAN and INF
From: Marty Kraimer <[email protected]>
To: "Rarback, Harvey" <[email protected]>
Cc: "'Brian McAllister'" <[email protected]>, "'[email protected]'" <[email protected]>, "'Clemens Wermelskirchen'" <[email protected]>
Date: Tue, 23 Apr 2002 07:34:35 -0500
OK,

I will use this.
I am not sure isinf should be true for a NAN but it looks like this is the best we can do.


Thanks,

Marty

Rarback, Harvey wrote:


Marty,



Brian McAllister wrote:


On 4/11/2002 at 8:54:36 PDT, Rarback, Harvey wrote:


 >> For VMS I could define epicsMath.h as
 >>
 >> #ifndef epicsMathh #define epicsMathh
 >>
 >> #include <math.h> #define isinf(D) 0
 >>
 >> #endif /* epicsMathh */
 >>
 >> Any better ideas for implementing isinf on VMS?

 > Sounds ok to me.  BTW, the same should apply to Tru64 Unix, aka Digital
 > Unix, aka OSF-1.

Digital Unix provides isnan()/isnanf() and finite()/finitef() for doubles
and floats, respectively.  In libm, defined in math.h.

finite() looks just like isinf().

----
Brian McAllister                    Controls Programmer/Beam Physicist
[email protected]                        MIT-Bates Linear Accelerator
(617) 253-9537                                           Middleton, MA


Sorry but I still don't know what I should do.

For alpha and for vms I currently have

#ifndef epicsMathh
#define epicsMathh

#include <math.h>
#define isinf(D) 0

#endif /* epicsMathh */


Are you suggesting?


ifndef epicsMathh
#define epicsMathh

#include <math.h>
#define isinf(D) (!finite((D)))

#endif /* epicsMathh */

Please dont' respont without testing because I have no way to test on alpha or
vms.


I tested the routines defined in math.h on


DEC C V5.9-005 on Digital UNIX V4.0 (Rev. 1229) and
Compaq C V6.2-003 on OpenVMS Alpha V7.3

and not surprisingly got the same results for the isnan and !finite routines:

a = 0.0   isnan(a) = 0  isinf(a) = 0
b = NaNQ  isnan(b) = 1  isinf(b) = 1
c = INF   isnan(c) = 0  isinf(c) = 1

--Harvey





References:
RE: NAN and INF Rarback, Harvey

Navigate by Date:
Prev: RE: NAN and INF Rarback, Harvey
Next: EPICS Licensing Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: NAN and INF Rarback, Harvey
Next: Eye-Line commissioned at NPTC Surajit Sarkar
Index: 1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  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 ·