version 1.4, 2003/07/25 12:34:48 |
version 1.7, 2009/03/27 14:42:29 |
|
|
/* |
/* |
* $OpenXM: OpenXM_contrib2/asir2000/engine/p-itv.c,v 1.3 2003/02/14 22:29:09 ohara Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/p-itv.c,v 1.6 2005/02/08 18:06:05 saito Exp $ |
*/ |
*/ |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
#include "ca.h" |
#include "ca.h" |
Line 50 void istoitv(Num inf, Num sup, Itv *rp) |
|
Line 50 void istoitv(Num inf, Num sup, Itv *rp) |
|
} else { |
} else { |
i = inf; |
i = inf; |
} |
} |
if ( type ) |
if ( type ) { |
NEWIntervalBigFloat((IntervalBigFloat)c); |
// NEWIntervalBigFloat((IntervalBigFloat)c); |
else |
c=MALLOC(sizeof(struct oIntervalBigFloat)); |
|
OID(c)=O_N; |
|
NID(c)=N_IntervalBigFloat; |
|
} else |
NEWItvP(c); |
NEWItvP(c); |
|
|
if ( compnum(0,i,s) >= 0 ) { |
if ( compnum(0,i,s) >= 0 ) { |
Line 260 void pwritvp(Itv a, Num e, Itv *c) |
|
Line 263 void pwritvp(Itv a, Num e, Itv *c) |
|
pwrnum(0,(Num)a,(Num)e,(Num *)c); |
pwrnum(0,(Num)a,(Num)e,(Num *)c); |
else if ( !INT(e) ) { |
else if ( !INT(e) ) { |
#if defined(PARI) && 0 |
#if defined(PARI) && 0 |
GEN pa,pe,z; |
gpui_ri((Obj)a,(Obj)c,(Obj *)c); |
int ltop,lbot; |
|
|
|
ltop = avma; ritopa(a,&pa); ritopa(e,&pe); lbot = avma; |
|
z = gerepile(ltop,lbot,gpui(pa,pe,prec)); |
|
patori(z,c); cgiv(z); |
|
#else |
#else |
error("pwritv : can't calculate a fractional power"); |
error("pwritv : can't calculate a fractional power"); |
#endif |
#endif |
Line 371 void miditvp(Itv a, Num *b) |
|
Line 369 void miditvp(Itv a, Num *b) |
|
{ |
{ |
Num ai,as; |
Num ai,as; |
Num t; |
Num t; |
Q TWO; |
|
|
|
if ( ! a ) *b = 0; |
if ( ! a ) *b = 0; |
else if ( (NID(a) <= N_B) ) |
else if ( (NID(a) <= N_B) ) |