TR1 Math

Paolo Carlini pcarlini@suse.de
Sun Mar 26 12:51:00 GMT 2006


Hi Ed,

> I have to accept that the TR1 math won't be done for 4.2.  However, I 
> have enough done that I think it would be worthwhile to report on the 
> status and get some feedback and suggestions and maybe some help. 

I'm looking into the patch draft. A few immediate, rather obvious 
comments for the next iteration.
1- There are some spurious merge markers, here and there.
2- Copyright years for new files only 2006, of course.
3- A few stylistic issues:
    - Watch overlong lines (*strictly* < 80).
    - No space after ( and before ).
    - No space after the template keyword.
    - Return type and function name in separate lines.
    - For clarity, avoid single letter variable names, in particular 
upper case (like __F). And, since we are uglifying everything (as we do 
for the library proper, a good idea, in my opinion), do it consistently 
(I see sign, alternate, without underscores, for example).
4- Use __throw_domain_error and co (via <bits/functexcept.h>)
5- Definitely too many inline keywords, should be removed from anything 
bigger than say, a few lines. Also, with templates, there are no linkage 
issues that would justify temporary abuses.
6- A few bibliographic references on top of specific algorithms would be 
much appreciated.
7- The __gnu_cxx::__capture_* functions do not always exist (see 
std_cmath.h), cannot be used unconditionally.
8- hard wired numerical tolerances should indeed go away (as per the 
TODOs). I would think that constants computed from various 
numeric_limits<> fields can do...
9- Finally, I don't think you are implementing correctly 5.2.1/5. For 
example, two parameters of type float and long double lead to the double 
version of the underlying implementation called, instead of the long 
double version (e.g., for beta). I think you have simply to use 
__promote_* another time, also when calling the underlying 
implementation, cmp. the stuff already in tr1/cmath.

Overall, I think we are very close to something we can actually commit!

Thanks a lot!
Paolo.



More information about the Libstdc++ mailing list