Marty,
Thanks for your reply concerning the accuracy of
converting a Double to a String within EPICS.
I have done some further investigation and found that
by setting PREC to 7 in the incoming record (the record
which is receiving the double), I do indeed get an accuracy
of 7 decimal places. However, changing PREC to 15 (which you
might want for the accuracy of a double),
I discovered that the double goes through with an
accuracy of only 5 decimal places!
The problem lies within the code for "cvtDoubleToString" inside
libCom/cvtFast.c. Line 150 of cvtFast.c shows that the value will
be converted to a string as follows, whenever PREC > 8.
sprintf(pstr_value,"%12.5e\0",flt_value);
I would say that "%12.5e" format is not what we want in
this case. Are there any plans to change this to something
which greater reflects the accuracy expected of a double?
Andy
==========================================================================
Andy Foster
Royal Greenwich Observatory Tel: 44 (0)1223 374899 (direct)
Madingley Road E-mail: [email protected]
Cambridge
CB3 0HA
UK
- Navigate by Date:
- Prev:
Re: AO rec flaw Marty Kraimer
- Next:
Re: Internal type conversion in Epics Marty Kraimer
- 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
- Navigate by Thread:
- Prev:
Re: Internal type conversion in Epics Marty Kraimer
- Next:
Re: Internal type conversion in Epics Marty Kraimer
- 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
|