[GiNaC-devel] new function class

Jens Vollinga vollinga at physik.uni-wuppertal.de
Wed Feb 15 11:01:37 CET 2006


Hi,

Richard B. Kreckel schrieb:
> Oh, I so much prefer return-value error signaling over throwing up^W 
> exceptions!

:-)

But seriously, I'm almost finished with implementing the new system. 
There are still some compile/link issues and then some checks/timings to 
be done.
One big task remains, though: choosing 
nice/convienent/powerful/new-but-similar macros for the definition of
functions. To this end I will send the patches then (next week?), so 
that we can discuss it further.

> The only thing that confuses me are the specializations introduced for 
> built-in floating point types.  The real conflicts are when the function 
> argument is a built-in integral type, as then there is a template 
> function in namespace std conflicting with the template function up 
> there.  Maybe you really meant to specialize for built-in integral types 
> because when using namespace GiNaC one would expect log10(2) to hold() 
> but log10(2.0) to evalf()?  Or did I miss something?

I don't have log10(numeric) yet. So writing

using namespace GiNaC;
ex r = log10(1.0);

would not call GiNaC::log10 but ::log10() [-> std::log10()] without 
giving any hint to the user.

I learned (after years of programming C++ ... ;-)) that gcc puts all the 
math functions not only in namespace std but also in the global 
namespace. While this behavior is wrong with respect to the ISO 
standard, I learned from Gabriel Dos Reis and others that this will 
probably never be fixed.

Regards,
Jens


More information about the GiNaC-devel mailing list