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

Diff for /OpenXM_contrib2/asir2000/io/bsave.c between version 1.16 and 1.17

version 1.16, 2009/03/16 16:43:03 version 1.17, 2015/08/04 06:20:45
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/bsave.c,v 1.15 2006/08/09 02:40:47 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/io/bsave.c,v 1.16 2009/03/16 16:43:03 ohara Exp $
 */  */
 /* saveXXX must not use GC_malloc(), GC_malloc_atomic(). */  /* saveXXX must not use GC_malloc(), GC_malloc_atomic(). */
   
Line 52 
Line 52 
 #include "parse.h"  #include "parse.h"
 #include "com.h"  #include "com.h"
   
 #if defined(PARI)  
 #include "genpari.h"  
 int get_lg(GEN);  
 #endif  
   
 void savenbp(FILE *s,NBP p);  void savenbp(FILE *s,NBP p);
   
 void (*savef[])() = { 0, savenum, savep, saver, savelist, savevect,  void (*savef[])() = { 0, savenum, savep, saver, savelist, savevect,
Line 115  void savereal(FILE *s,Real p)
Line 110  void savereal(FILE *s,Real p)
   
 void savebf(FILE *s,BF p)  void savebf(FILE *s,BF p)
 {  {
 #if defined(PARI)    unsigned int zero = 0;
         GEN z;    unsigned int prec;
         int sign;          L exp;
         unsigned long expo;    int sgn,len,t;
         unsigned int len,t;  
   
         z = (GEN)BDY(p);    prec = MPFR_PREC(p->body);
         sign = signe(z);    exp = MPFR_EXP(p->body);
         len = lg(z)-2;    sgn = MPFR_SIGN(p->body);
         expo = expo(z);          len = MPFR_LIMB_SIZE(p->body);
   
         write_int(s,&sign);          write_int(s,&sgn);
           write_int(s,(int *)&prec);
           write_int64(s,(UL *)&exp);
 #if SIZEOF_LONG == 4  #if SIZEOF_LONG == 4
         write_int(s,(int *)&zeroval); /* expo>>32 is always 0 */  
         write_int(s,(int *)&expo);  
         write_int(s,&len);          write_int(s,&len);
         write_intarray(s,(int *)&z[2],len);          write_intarray(s,p->body->_mpfr_d,len);
 #elif SIZEOF_LONG == 8  #else /* SIZEOF_LONG == 8 */
         t = expo>>32; write_int(s,(int *)&t);          t = 2*len;
         t = expo&0xffffffff; write_int(s,&t);          write_int(s,&t);
         t = 2*len; write_int(s,&t);          write_longarray(s,p->body->_mpfr_d,len);
         write_longarray(s,&z[2],len);  
 #endif  
 #else  
         error("savebf : PARI is not combined");  
 #endif  #endif
 }  }
   

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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