version 1.42, 2017/08/31 02:36:21 |
version 1.44, 2018/03/29 07:50:06 |
|
|
* 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/pexpr.c,v 1.41 2015/08/20 08:53:05 ohara Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr.c,v 1.43 2018/03/29 01:32:53 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "al.h" |
#include "al.h" |
Line 127 int printmode = PRINTF_G; |
|
Line 127 int printmode = PRINTF_G; |
|
/* spetial functions for file output */ |
/* spetial functions for file output */ |
|
|
void output_init() { |
void output_init() { |
OUT = stdout; |
OUT = stdout; |
sprintf(DFORMAT,"%%0%dd",DLENGTH); |
sprintf(DFORMAT,"%%0%dd",DLENGTH); |
} |
} |
|
|
int mmono(p) |
int mmono(p) |
P p; |
P p; |
{ |
{ |
if ( NUM(p) ) |
if ( NUM(p) ) |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
if ( NID(p) != N_IP && NID(p) != N_IntervalDouble && NID(p) != N_IntervalQuad && NID(p) != N_IntervalBigFloat |
if ( NID(p) != N_IP && NID(p) != N_IntervalDouble && NID(p) != N_IntervalQuad && NID(p) != N_IntervalBigFloat |
&& compnum(CO,(Num)p,0) < 0 ) |
&& compnum(CO,(Num)p,0) < 0 ) |
#else |
#else |
if ( compnum(CO,(Num)p,0) < 0 ) |
if ( compnum(CO,(Num)p,0) < 0 ) |
#endif |
#endif |
return ( 1 ); |
return ( 1 ); |
else |
else |
return ( 0 ); |
return ( 0 ); |
else if ( NEXT(DC(p)) ) |
else if ( NEXT(DC(p)) ) |
return ( 0 ); |
return ( 0 ); |
else |
else |
return (mmono(COEF(DC(p)))); |
return (mmono(COEF(DC(p)))); |
} |
} |
|
|
void printbf(BF a) |
void printbf(BF a) |
{ |
{ |
int dprec; |
int dprec; |
char fbuf[BUFSIZ]; |
char fbuf[BUFSIZ]; |
char *s; |
char *s; |
dprec = (a->body->_mpfr_prec)*0.30103; |
dprec = (a->body->_mpfr_prec)*0.30103; |
if ( !dprec ) dprec = 1; |
if ( !dprec ) dprec = 1; |
sprintf(fbuf,"%%.%dR%c",dprec,double_output?'f':'g'); |
sprintf(fbuf,"%%.%dR%c",dprec,(double_output==1)?'f':(double_output==2)?'e':'g'); |
mpfr_asprintf(&s,fbuf,a->body); |
mpfr_asprintf(&s,fbuf,a->body); |
TAIL PUTS(s); |
TAIL PUTS(s); |
mpfr_free_str(s); |
mpfr_free_str(s); |
} |
} |
|
|