Mark Wielaard wrote:
> On Tue, 2006-01-10 at 11:49 +0100, Mark Wielaard wrote:
> 
>>BTW, does anybody know why we are not using the system strtod() when
>>available? That seems the way to the quickest solution on most
>>platforms. It seems to work with some simple tests for me. But I notice
>>that there is no strtod_r(), just strtod(). But I couldn't find a
>>definitive answer on whether or not the standard strtod() is guaranteed
>>to be thread-safe or not. Does anybody know (where to find this
>>information)?
> 
> 
> OK found that out myself. Apparently some strtod implementations are
> indeed not thread-safe by default (but most seem to be). The other
> problem is that strtod depends on the locale and changing the locale
> isn't thread-safe... sigh. So we do need our own implementation, or do
> something like glib g_ascii_strtod() and convert the string
> representation first to the current locale form (eeeewwww).
> 

In addition, many strotod implementations I encountered are subtly
different when it comes to having the results that the Java specs demand
for very small values. I guess that has a lot to do with floating point
rounding modes being largely implementation dependant in C89 [1], so
when porting to a C89-ish strtod one can only hope that the libc in
question has been compiled with the right options/switches/assembly. :/

cheers,
dalibor topic

[1] that's one of the reasons why I prefer C99 over C89, personally.


_______________________________________________
Classpath mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to