version 1.1, 2018/09/19 05:45:07 |
version 1.2, 2018/09/28 08:20:28 |
|
|
/* |
/* |
* $OpenXM$ |
* $OpenXM: OpenXM_contrib2/asir2018/engine/t-itv.c,v 1.1 2018/09/19 05:45:07 noro Exp $ |
*/ |
*/ |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
#include "ca.h" |
#include "ca.h" |
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); |
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 251 void pwritv0p(Itv a, int e, Itv *c) |
|
Line 251 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 330 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); |