version 1.1, 2018/09/19 05:45:07 |
version 1.3, 2019/10/17 03:03:12 |
|
|
/* |
/* |
* $OpenXM$ |
* $OpenXM: OpenXM_contrib2/asir2018/engine/t-itv.c,v 1.2 2018/09/28 08:20:28 noro Exp $ |
*/ |
*/ |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
#include "ca.h" |
#include "ca.h" |
Line 217 void divitvp(Itv a, Itv b, Itv *c) |
|
Line 217 void divitvp(Itv a, Itv b, Itv *c) |
|
|
|
void pwritvp(Itv a, Num e, Itv *c) |
void pwritvp(Itv a, Num e, Itv *c) |
{ |
{ |
int ei; |
long ei; |
Itv t; |
Itv t; |
|
|
if ( !e ) |
if ( !e ) |
Line 233 void pwritvp(Itv a, Num e, Itv *c) |
|
Line 233 void pwritvp(Itv a, Num e, Itv *c) |
|
error("pwritv : can't calculate a fractional power"); |
error("pwritv : can't calculate a fractional power"); |
#endif |
#endif |
} else { |
} else { |
ei = QTOS((Q)e); |
//ei = ZTOS((Q)e); |
|
ei = mpz_get_si(BDY((Q)e)); |
pwritv0p(a,ei,&t); |
pwritv0p(a,ei,&t); |
if ( SGN((Q)e) < 0 ) |
if ( SGN((Q)e) < 0 ) |
divnum(0,(Num)ONE,(Num)t,c); |
divnum(0,(Num)ONE,(Num)t,c); |
Line 242 void pwritvp(Itv a, Num e, Itv *c) |
|
Line 243 void pwritvp(Itv a, Num e, Itv *c) |
|
} |
} |
} |
} |
|
|
void pwritv0p(Itv a, int e, Itv *c) |
void pwritv0p(Itv a, long e, Itv *c) |
{ |
{ |
Num inf, sup; |
Num inf, sup; |
Num ai,Xmin,Xmax; |
Num ai,Xmin,Xmax; |
Line 251 void pwritv0p(Itv a, int e, Itv *c) |
|
Line 252 void pwritv0p(Itv a, int e, Itv *c) |
|
if ( e == 1 ) |
if ( e == 1 ) |
*c = a; |
*c = a; |
else { |
else { |
STOQ(e,ne); |
STOZ(e,ne); |
if ( !(e%2) ) { |
if ( !(e%2) ) { |
if ( initvp(0,a) ) { |
if ( initvp(0,a) ) { |
Xmin = 0; |
Xmin = 0; |
Line 330 void miditvp(Itv a, Num *b) |
|
Line 331 void miditvp(Itv a, Num *b) |
|
else if ( (NID(a) <= N_B) ) |
else if ( (NID(a) <= N_B) ) |
*b = (Num)a; |
*b = (Num)a; |
else { |
else { |
STOQ(2,TWO); |
//STOZ(2,TWO); |
itvtois(a,&ai,&as); |
itvtois(a,&ai,&as); |
addnum(0,ai,as,&t); |
addnum(0,ai,as,&t); |
divnum(0,t,TWO,b); |
divnum(0,t,TWO,b); |