Changeset eb059c5 in git
- Timestamp:
- Aug 4, 2004, 3:21:55 PM (19 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- fd1978167b53af9ab851cd4eb86936122d35a7d4
- Parents:
- 6c90074698fffbdf3734e19fde2653870561607e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/longrat.cc
r6c9007 reb059c5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longrat.cc,v 1. 2 2004-06-04 13:23:10Singular Exp $ */4 /* $Id: longrat.cc,v 1.3 2004-08-04 13:21:55 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computation with long rational numbers (Hubert Grassmann) … … 97 97 omBin rnumber_bin = omGetSpecBin(sizeof(snumber)); 98 98 99 number nlOne= nlInit(1);99 number nlOne=INT_TO_SR(1); 100 100 101 101 #if (__GNU_MP_VERSION*10+__GNU_MP_VERSION_MINOR < 31) … … 229 229 { 230 230 double f=nrFloat(from); 231 if (f==0.0) return nlInit(0);231 if (f==0.0) return INT_TO_SR(0); 232 232 int f_sign=1; 233 233 if (f<0.0) … … 265 265 size = (*f)[0]._mp_size; 266 266 if (size == 0) 267 return nlInit(0);267 return INT_TO_SR(0); 268 268 if(size<0) 269 269 { … … 1145 1145 { 1146 1146 nlDelete(&x,currRing); 1147 x= nlInit(0);1147 x=INT_TO_SR(0); 1148 1148 return; 1149 1149 } … … 1202 1202 else if (divided) 1203 1203 { 1204 _mpz_realloc(&x->n,mpz_size1(&x->n)); 1205 } 1206 if (divided) _mpz_realloc(&x->z,mpz_size1(&x->z)); 1204 #define mpz_alloc1(A) ((A)->_mp_alloc) 1205 int l; 1206 if ((mpz_alloc1(&x->n)>>1) >= (l=mpz_size1(&x->n))) 1207 { 1208 _mpz_realloc(&x->n,il /* mpz_size1(&x->n)*/); 1209 } 1210 } 1211 if (divided)i 1212 { 1213 int l; 1214 if ((mpz_alloc1(&x->z)>>1) >= (l=mpz_size1(&x->z))) 1215 { 1216 _mpz_realloc(&x->z,l /*mpz_size1(&x->z)*/); 1217 } 1218 } 1207 1219 } 1208 1220 #ifdef LDEBUG
Note: See TracChangeset
for help on using the changeset viewer.