=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/pexpr.c,v retrieving revision 1.38 retrieving revision 1.41 diff -u -p -r1.38 -r1.41 --- OpenXM_contrib2/asir2000/io/pexpr.c 2004/12/17 03:09:08 1.38 +++ OpenXM_contrib2/asir2000/io/pexpr.c 2015/08/20 08:53:05 1.41 @@ -44,7 +44,7 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM: OpenXM_contrib2/asir2000/io/pexpr.c,v 1.37 2004/07/13 07:59:54 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/pexpr.c,v 1.40 2015/08/04 06:20:45 noro Exp $ */ #include "ca.h" #include "al.h" @@ -56,10 +56,6 @@ #define FPRINT #endif -#if defined(PARI) -#include "genpari.h" -#endif - extern int outputstyle; FILE *asir_out; @@ -107,6 +103,7 @@ int printmode = PRINTF_G; #define PRINTBYTEARRAY printbytearray #define PRINTQUOTE printquote #define PRINTQUOTEARG printquotearg +#define PRINTNBP printnbp #define PRINTERR printerr #define PRINTLF printlf #define PRINTLOP printlop @@ -152,11 +149,16 @@ P p; return (mmono(COEF(DC(p)))); } -#if defined(PARI) -void printbf(a) -BF a; +void printbf(BF a) { - sor(a->body,double_output ? 'f' : 'g',-1,0); + int dprec; + char fbuf[BUFSIZ]; + char *s; + dprec = (a->body->_mpfr_prec)*0.30103; + if ( !dprec ) dprec = 1; + sprintf(fbuf,"%%.%dR%c",dprec,double_output?'f':'g'); + mpfr_asprintf(&s,fbuf,a->body); + TAIL PUTS(s); + mpfr_free_str(s); } -#endif