version 1.2, 2002/01/08 04:14:37 |
version 1.4, 2003/07/25 12:34:47 |
|
|
/* |
/* |
* $OpenXM: OpenXM_contrib2/asir2000/engine/f-itv.c,v 1.1 2000/12/22 10:03:28 saito Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/f-itv.c,v 1.3 2003/02/14 22:29:08 ohara Exp $ |
*/ |
*/ |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
#include "ca.h" |
#include "ca.h" |
#include "base.h" |
#include "base.h" |
#if PARI |
#if defined(PARI) |
#include "genpari.h" |
#include "genpari.h" |
#include "itv-pari.h" |
#include "itv-pari.h" |
extern long prec; |
extern long prec; |
Line 368 void pwritvf(Itv a, Num e, Itv *c) |
|
Line 368 void pwritvf(Itv a, Num e, Itv *c) |
|
else if ( NID(a) <= N_B ) |
else if ( NID(a) <= N_B ) |
pwrnum(0,(Num)a,e,(Num *)c); |
pwrnum(0,(Num)a,e,(Num *)c); |
else if ( !INT(e) ) { |
else if ( !INT(e) ) { |
#if PARI && 0 |
#if defined(PARI) && 0 |
GEN pa,pe,z; |
GEN pa,pe,z; |
int ltop,lbot; |
int ltop,lbot; |
|
|
Line 451 int cmpitvf(Itv a, Itv b) |
|
Line 451 int cmpitvf(Itv a, Itv b) |
|
int s,t; |
int s,t; |
|
|
if ( !a ) { |
if ( !a ) { |
if ( !b || (NID(b)<=N_B) ) |
if ( !b || (NID(b)<=N_B) ) { |
return compnum(0,(Num)a,(Num)b); |
return compnum(0,(Num)a,(Num)b); |
else |
} else { |
return -1; |
itvtois(b,&bi,&bs); |
|
if ( compnum(0,(Num)a,bs) > 0 ) return 1; |
|
else if ( compnum(0,bi,(Num)a) > 0 ) return -1; |
|
else return 0; |
|
} |
} else if ( !b ) { |
} else if ( !b ) { |
if ( !a || (NID(a)<=N_B) ) |
if ( !a || (NID(a)<=N_B) ) { |
return compnum(0,(Num)a,(Num)b); |
return compnum(0,(Num)a,(Num)b); |
else |
} else { |
return initvp((Num)b,a); |
itvtois(a,&ai,&as); |
|
if ( compnum(0,ai,(Num)b) > 0 ) return 1; |
|
else if ( compnum(0,(Num)b,as) > 0 ) return -1; |
|
else return 0; |
|
} |
} else { |
} else { |
itvtois(a,&ai,&as); |
itvtois(a,&ai,&as); |
itvtois(b,&bi,&bs); |
itvtois(b,&bi,&bs); |