On Jun 5, 2012, at 9:46 AM, Andrew Johnson wrote:
> Hi Eric,
>
> On Jun 5, 2012, at 6:11 AM, Dirk Zimoch wrote:
>>
>> I think adding something like this to epicsStrtod should fix the problem:
>>
>> if (epicsStrnCaseCmp("0x", cp, 2) == 0) {
>> return (double)strtoul(str, endp, 16);
>> }
>
> I'll be using strtol() instead in the 3.15 code, so -0x1 works.
Right.
>
> On 2012-06-05 Eric Norum wrote:
>> The code with that change doesn't completely match the semantics of strtod
>> as presented in the C99 standard, but it's certainly better than the
>> current code.
>
> What else are we missing? I don't have the C99 standard to look at here.
A '0x' number can have a fractional part and an exponent. This seems pretty esoteric so its absence is, IMHO, minor.
>
>> BTW -- does vxWorks still not supply a working strtod? I
>> think that it is the only system that doesn't just define epicsStrtod as
>> strtod.
>
> The wording in the vxWorks 6.8 manpage is exactly the same as Dirk posted from
> vxWorks 5.5.
:-(
>
> No, we use our version of epicsStrtod() on Windows, Cygwin, vxWorks and
> Solaris. I have a branch for 3.15 where I've been working on the numeric
> conversions, I'll add some tests for the native strtod().
>
Yuck.
After over 12 years they still can't produce a strtod that matches the standard? (!!!)
--
Eric Norum
[email protected]
- Replies:
- Re: mask for bitwise operation in CALC record Dirk Zimoch
- References:
- mask for bitwise operation in CALC record haquin
- Re: mask for bitwise operation in CALC record Dirk Zimoch
- Re: mask for bitwise operation in CALC record Eric Norum
- Re: mask for bitwise operation in CALC record Andrew Johnson
- Navigate by Date:
- Prev:
Re: mask for bitwise operation in CALC record Andrew Johnson
- Next:
Announcement of PCaPAC-2012 Shantonu Sahoo
- 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: mask for bitwise operation in CALC record Andrew Johnson
- Next:
Re: mask for bitwise operation in CALC record Dirk Zimoch
- 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
|