[BACK]Return to pexpr.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / io

Diff for /OpenXM_contrib2/asir2000/io/pexpr.c between version 1.37 and 1.45

version 1.37, 2004/07/13 07:59:54 version 1.45, 2019/11/12 10:52:04
Line 44 
Line 44 
  * 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.36 2004/05/14 06:02:54 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/io/pexpr.c,v 1.44 2018/03/29 07:50:06 ohara Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "al.h"  #include "al.h"
Line 56 
Line 56 
 #define FPRINT  #define FPRINT
 #endif  #endif
   
 #if defined(PARI)  
 #include "genpari.h"  
 #endif  
   
 extern int outputstyle;  extern int outputstyle;
   
 FILE *asir_out;  FILE *asir_out;
Line 72  int real_digit;
Line 68  int real_digit;
 int real_binary;  int real_binary;
 int print_quote;  int print_quote;
 int hideargs;  int hideargs;
 extern int asir_texmacs;  
 extern FUNC user_print_function;  extern FUNC user_print_function;
 #if 0  #if 0
 int printmode = PRINTF_E;  int printmode = PRINTF_E;
Line 102  int printmode = PRINTF_G;
Line 97  int printmode = PRINTF_G;
 #define PRINTSTR printstr  #define PRINTSTR printstr
 #define PRINTCOMP printcomp  #define PRINTCOMP printcomp
 #define PRINTDP printdp  #define PRINTDP printdp
   #define PRINTDPM printdpm
 #define PRINTUI printui  #define PRINTUI printui
 #define PRINTGF2MAT printgf2mat  #define PRINTGF2MAT printgf2mat
 #define PRINTGFMMAT printgfmmat  #define PRINTGFMMAT printgfmmat
 #define PRINTBYTEARRAY printbytearray  #define PRINTBYTEARRAY printbytearray
 #define PRINTQUOTE printquote  #define PRINTQUOTE printquote
 #define PRINTQUOTEARG printquotearg  #define PRINTQUOTEARG printquotearg
   #define PRINTNBP printnbp
 #define PRINTERR printerr  #define PRINTERR printerr
 #define PRINTLF printlf  #define PRINTLF printlf
 #define PRINTLOP printlop  #define PRINTLOP printlop
Line 125  int printmode = PRINTF_G;
Line 122  int printmode = PRINTF_G;
 #define PRINTFNODENODE printfnodenode  #define PRINTFNODENODE printfnodenode
 #define PRINTFARGS printfargs  #define PRINTFARGS printfargs
   
   #if defined(INTERVAL)
   #define PRINTBF4ITV printbf4itv
   #endif
   
 #include "pexpr_body.c"  #include "pexpr_body.c"
   
 /* 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))));
 }  }
   
 #if defined(PARI)  void printbf(BF a)
 void printbf(a)  
 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==1)?'f':(double_output==2)?'e':'g');
     mpfr_asprintf(&s,fbuf,a->body);
     TAIL PUTS(s);
     mpfr_free_str(s);
   }
   
   #if defined(INTERVAL)
   void printbf4itv(BF a)
   {
     int dprec;
     char fbuf[BUFSIZ];
     char *s;
     dprec = (a->body->_mpfr_prec)*0.30103;
     if ( !dprec ) dprec = 1;
     dprec += 1;
     sprintf(fbuf,"%%.%dR%c",dprec,(double_output==1)?'f':(double_output==2)?'e':'g');
     mpfr_asprintf(&s,fbuf,a->body);
     TAIL PUTS(s);
     mpfr_free_str(s);
 }  }
 #endif  #endif
   

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.45

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>