version 1.8, 2000/12/16 06:16:10 |
version 1.9, 2000/12/22 10:03:31 |
|
|
* OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY |
* OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY |
* 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/io/spexpr.c,v 1.7 2000/12/15 05:30:08 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/io/spexpr.c,v 1.8 2000/12/16 06:16:10 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "al.h" |
#include "al.h" |
|
|
P p; |
P p; |
{ |
{ |
if ( NUM(p) ) |
if ( NUM(p) ) |
|
#if defined(INTERVAL) |
|
if ( NID(p) != N_IP && compnum(CO,(Num)p,0) < 0 ) |
|
#else |
if ( compnum(CO,(Num)p,0) < 0 ) |
if ( compnum(CO,(Num)p,0) < 0 ) |
|
#endif |
return ( 1 ); |
return ( 1 ); |
else |
else |
return ( 0 ); |
return ( 0 ); |
|
|
} |
} |
} |
} |
|
|
|
extern int printmode; |
|
|
void PRINTNUM(q) |
void PRINTNUM(q) |
Num q; |
Num q; |
{ |
{ |
|
|
} |
} |
break; |
break; |
case N_R: |
case N_R: |
TAIL PRINTF(OUT,double_output?"%f":"%g",BDY((Real)q)); |
switch (printmode) { |
|
case PRINTF_E: |
|
#if defined(INTERVAL) |
|
case MID_PRINTF_E: |
|
#endif |
|
TAIL PRINTF(OUT,"%.15e",BDY((Real)q)); |
|
break; |
|
case PRINTF_G: |
|
#if defined(INTERVAL) |
|
case MID_PRINTF_G: |
|
#endif |
|
default: |
|
TAIL PRINTF(OUT,"%g",BDY((Real)q)); |
|
break; |
|
} |
break; |
break; |
case N_A: |
case N_A: |
PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")"); |
PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")"); |
|
|
#if PARI |
#if PARI |
case N_B: |
case N_B: |
PRINTBF((BF)q); break; |
PRINTBF((BF)q); break; |
|
#endif |
|
#if defined(INTERVAL) |
|
case N_IP: |
|
case N_IF: |
|
PUTS("["); |
|
PRINTNUM(INF((Itv)q)); |
|
PUTS(","); |
|
PRINTNUM(SUP((Itv)q)); |
|
PUTS("]"); |
|
break; |
|
case N_ID: |
|
switch (printmode) { |
|
case PRINTF_E: |
|
TAIL PRINTF(OUT, "[%.16e,%.16e]",INF((ItvD)q),SUP((ItvD)q)); |
|
#if defined(ITVDEBUG) |
|
printbin(INF((ItvD)q)); |
|
printbin(SUP((ItvD)q)); |
|
#endif |
|
break; |
|
case MID_PRINTF_G: |
|
TAIL PRINTF(OUT, "<%g,%g>", (SUP((ItvD)q)+INF((ItvD)q))*0.5,(SUP((ItvD)q)-INF((ItvD)q))*0.5); |
|
break; |
|
case MID_PRINTF_E: |
|
TAIL PRINTF(OUT, "<%.16e,%.16e>", (SUP((ItvD)q)+INF((ItvD)q))*0.5,(SUP((ItvD)q)-INF((ItvD)q))*0.5); |
|
break; |
|
case PRINTF_G: |
|
default: |
|
TAIL PRINTF(OUT, "[%g,%g]",INF((ItvD)q),SUP((ItvD)q)); |
|
break; |
|
} |
|
break; |
#endif |
#endif |
case N_C: |
case N_C: |
PRINTCPLX((C)q); break; |
PRINTCPLX((C)q); break; |