version 1.5, 2003/02/14 22:29:08 |
version 1.6, 2009/03/27 14:42:29 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/engine/cplx.c,v 1.4 2000/12/22 10:03:28 saito Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/cplx.c,v 1.5 2003/02/14 22:29:08 ohara Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "base.h" |
#include "base.h" |
#if defined(PARI) |
#if defined(PARI) |
#include "genpari.h" |
#include "genpari.h" |
void patori(GEN,Obj *); |
|
void patori_i(GEN,N *); |
|
void ritopa(Obj,GEN *); |
|
void ritopa_i(N,int,GEN *); |
|
#endif |
#endif |
|
|
void toreim(a,rp,ip) |
void toreim(a,rp,ip) |
|
|
{ |
{ |
int ei; |
int ei; |
Num t; |
Num t; |
extern long prec; |
|
|
|
if ( !e ) |
if ( !e ) |
*c = (Num)ONE; |
*c = (Num)ONE; |
|
|
*c = 0; |
*c = 0; |
else if ( !INT(e) ) { |
else if ( !INT(e) ) { |
#if defined(PARI) |
#if defined(PARI) |
GEN pa,pe,z; |
gpui_ri((Obj)a,(Obj)c,(Obj *)c); |
int ltop,lbot; |
|
|
|
ltop = avma; ritopa((Obj)a,&pa); ritopa((Obj)e,&pe); lbot = avma; |
|
z = gerepile(ltop,lbot,gpui(pa,pe,prec)); |
|
patori(z,(Obj *)c); cgiv(z); |
|
#else |
#else |
error("pwrcplx : can't calculate a fractional power"); |
error("pwrcplx : can't calculate a fractional power"); |
#endif |
#endif |