|
The patch is attached.
ChangeLog: STDCXX-880 * src/num_put.cpp (max_double_t): New typedef for defining the floating-point type with max precision. Implement generic functions that not using the math library functions, instead of just "return false". (__rw_isfinite): Define function for max_double_t type instead of double. (__rw_signbit): Ditto. (__rw_isinf): Ditto. (__rw_isnan): Ditto. (__rw_isqnan): Ditto. (__rw_issnan): Ditto. (__rw_fmat_infinite): Ditto. I'm only not sure about Solaris OS. I don't see in the documentation at docs.sun.com that there are present fpclass(), finite(), ... functions for long double type.
But now we need the only finite() implemented for long double. Other functions can be implemented for double type (I believe that inf and nan values are correctly converting from long double into double). I'm not sure about converting double to max_double_t. Is it safe in terms of traps and floating point exceptions? Is it efficient? Why can't we just have three overloads of these functions for each of the three floating point types?
In any event, it's far too late to be changing the implementation of the double overloads to long double, or to be adding non-trivial implementations the generic functions for 4.2.1. Besides, the new generic functions are unsafe. They must avoid traps, so any kind of floating point arithmetic is out of the question. On platforms with limited support for these kinds of things (e.g., HP-UX on PA-RISC where the arguments must be float or double – see for example the fpclassify(3m) For 4.2.1, we need the simplest, safest possible fix, or we need to revert the patch. Fixed in trunk thus http://svn.apache.org/viewvc?rev=650902&view=rev
Will be closed after merging the chanbges in 4.2.x branch. Merged in 4.2.x branch thus: http://svn.apache.org/viewvc?rev=651034&view=rev
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Farid please take a look at this (FWIW, it looks like we're missing long double overloads for the new functions added in the change).