This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix strtod for small DBL_DIG




On 05/16/2011 03:35 PM, Corinna Vinschen wrote:
On May 16 15:27, Peter Rosin wrote:
Den 2011-05-16 14:33 skrev Corinna Vinschen:
Thanks for the testcase.  However, I can still not reproduce the
problem.  I tried again with float and strtof on Cygwin, but
regardless of running it with or without your patch, it results
in printing

12.3456789 12.3456789

The strtod_r code is plain C so I'd expect that the conversion
is target independent.  So why would it fail for arm but not for
i386?

Perhaps the reason for that is that in the arm case the double inside strtod_r is only 32 bits? Try replacing the local doubles with floats?

There's also a whole bunch of code conditional on _DOUBLE_IS_32BITS
to consider.

You have a point there. Ok, I can't test that easily and since it works fine for sizeof(double)==8 systems, and since Christian has apparently tested his patch, I checked it in.


Many thanks,


Just note for the record that the original report was for SH4, not ARM. (although I did test on ARM as well).

Best Regards

Christian


Thanks, Corinna



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]