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

Diff for /OpenXM_contrib2/asir2000/io/spexpr.c between version 1.5 and 1.8

version 1.5, 2000/11/08 08:02:51 version 1.8, 2000/12/16 06:16:10
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/spexpr.c,v 1.4 2000/08/22 05:04:18 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/io/spexpr.c,v 1.7 2000/12/15 05:30:08 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "al.h"  #include "al.h"
Line 103  static char *buf;
Line 103  static char *buf;
 extern char DFORMAT[BUFSIZ];  extern char DFORMAT[BUFSIZ];
 extern int hex_output;  extern int hex_output;
 extern int fortran_output;  extern int fortran_output;
   extern int double_output;
   
 #define TAIL while ( *OUT ) OUT++;  #define TAIL while ( *OUT ) OUT++;
 #define PUTS(s) strcat(OUT,s)  #define PUTS(s) strcat(OUT,s)
Line 182  P p;
Line 183  P p;
 void printbf(a)  void printbf(a)
 BF a;  BF a;
 {  {
         sor(a->body,'g',-1,0);          sor(a->body,double_output ? 'f' : 'g',-1,0);
 }  }
 #endif  #endif
 #endif  #endif
Line 195  char *s;
Line 196  char *s;
 }  }
   
 #if PARI  #if PARI
   #include "genpari.h"
   
   void myoutbrute(g)
   GEN g;
   {
           bruteall(g,'f',-1,1);
   }
   
 void sprintbf(a)  void sprintbf(a)
 BF a;  BF a;
 {  {
         char *str;          char *str;
         char *GENtostr();          char *GENtostr();
           char *GENtostr0();
   
         str = GENtostr(a->body);          if ( double_output ) {
                   str = GENtostr0(a->body,myoutbrute);
           } else {
                   str = GENtostr(a->body);
           }
         TAIL PRINTF(OUT,"%s",str);          TAIL PRINTF(OUT,"%s",str);
         free(str);          free(str);
 }  }
Line 303  Num q;
Line 317  Num q;
                         }                          }
                         break;                          break;
                 case N_R:                  case N_R:
                         TAIL PRINTF(OUT,"%g",BDY((Real)q));                          TAIL PRINTF(OUT,double_output?"%f":"%g",BDY((Real)q));
                         break;                          break;
                 case N_A:                  case N_A:
                         PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")");                          PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")");
Line 628  BYTEARRAY array;
Line 642  BYTEARRAY array;
         unsigned char *b;          unsigned char *b;
   
         len = array->len;          len = array->len;
         b =array->body;          b = array->body;
         PUTS("|");          PUTS("|");
         for ( i = 0; i < len-1; i++ ) {          for ( i = 0; i < len-1; i++ ) {
                 TAIL PRINTF(OUT,"%02x ",b[i]);                  TAIL PRINTF(OUT,"%02x ",(unsigned int)b[i]);
         }          }
         TAIL PRINTF(OUT,"%02x",b[i]);          TAIL PRINTF(OUT,"%02x",(unsigned int)b[i]);
         PUTS("|");          PUTS("|");
 }  }
   

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.8

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