[CLN-list] Types in cl_R

Richard B. Kreckel kreckel at thep.physik.uni-mainz.de
Wed Nov 17 22:32:03 CET 2004


On Tue, 16 Nov 2004, Isidro [iso-8859-15] Cachadiña Gutiérrez wrote:
> I am using cln with real numbers. I have a problem in the expt function...
[...]

> I also can define this function as:
>
> cln::cl_R expt(cln::cl_R x, cln::cl_R y)
> {
>   return exp(x*ln(y));
> }
>
> And It works fine,  but I think that It have to be defined somewhere in the
> library.

Well, only if `x' is positive, right?  Or if `y' is integer.  But that
signature is there, as you've already seen.  Otherwise, the range of the
exponentiation function isn't R anyway, so you could equally well use
expt(cl_N,cl_N), returning an cl_N object.

Maybe it would be worthwhile though, considering the fact that we also
have sqrt(cl_R) defined only for arguments >= 0 without type checks for
that.  But given the other signatures, I see only very limited use.

Saludos
 -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>




More information about the CLN-list mailing list