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

Diff for /OpenXM_contrib2/asir2018/io/pexpr.c between version 1.2 and 1.7

version 1.2, 2018/10/01 05:49:06 version 1.7, 2022/04/03 00:49:25
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/asir2018/io/pexpr.c,v 1.1 2018/09/19 05:45:08 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2018/io/pexpr.c,v 1.6 2020/02/01 14:20:42 ohara Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "al.h"  #include "al.h"
Line 123  int printmode = PRINTF_G;
Line 123  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 */
Line 164  void printbf(BF a)
Line 168  void printbf(BF a)
   mpfr_free_str(s);    mpfr_free_str(s);
 }  }
   
   #if defined(INTERVAL)
   void printbf4itv(BF a)
   {
     int dprec;
     char fbuf[BUFSIZ];
     char *s;
   
     if ( !a ) {
       TAIL PUTS("0");
     }
     else {
       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
   
 void printz(Z n)  void printz(Z n)
 {  {
   if ( hex_output == 1 ) {    printmpz(BDY(n));
     TAIL PUTS("0x");  
     mpz_out_str(OUT,16,BDY(n));  
   } else  
     mpz_out_str(OUT,10,BDY(n));  
 }  }
   
 void printmpz(mpz_t z)  void printmpz(mpz_t z)
 {  {
   #if !defined(VISUAL)
   if ( hex_output == 1 ) {    if ( hex_output == 1 ) {
     TAIL PUTS("0x");      TAIL PUTS("0x");
     mpz_out_str(OUT,16,z);      mpz_out_str(OUT,16,z);
     } else if ( hex_output == 2 ) {
       TAIL PUTS("0b");
       mpz_out_str(OUT,2,z);
   } else    } else
     mpz_out_str(OUT,10,z);      mpz_out_str(OUT,10,z);
   #else
     char *s;
     if ( hex_output == 1 ) {
       TAIL PUTS("0x");
       s = mpz_get_str(0,16,z);
     } else if ( hex_output == 2 ) {
       TAIL PUTS("0b");
       mpz_out_str(0,2,z);
     } else {
       s = mpz_get_str(0,10,z);
     }
     TAIL PUTS(s);
   #endif
 }  }
   

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.7

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