Changeset cc3240c in git
- Timestamp:
- Feb 8, 2012, 3:49:13 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 65c5f5710da694616a5f4f24bb00f15eb0ddfae6
- Parents:
- c8e03004b0f2c558839cdce7d26c2b7978191d54
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2012-02-08 15:49:13+01:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2012-02-08 15:49:55+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/longrat.cc
rc8e030 rcc3240c 31 31 { 32 32 assume(x->s==3); 33 if ((mpz_cmp_ui(x->z,(long)0)==0) 34 || (mpz_size1(x->z)<=MP_SMALL)) 33 if (mpz_cmp_ui(x->z,(long)0)==0) 34 { 35 mpz_clear(x->z); 36 FREE_RNUMBER(x); 37 return INT_TO_SR(0); 38 } 39 if (mpz_size1(x->z)<=MP_SMALL) 35 40 { 36 41 LONG ui=mpz_get_si(x->z); … … 2138 2143 LINLINE BOOLEAN nlIsZero (number a, const coeffs) 2139 2144 { 2145 #if 0 2146 if (a==INT_TO_SR(0)) return TRUE; 2147 if ((SR_HDL(a) & SR_INT)||(a==NULL)) return FALSE; 2148 if (mpz_cmp_si(a->z,(long)0)==0) 2149 { 2150 printf("gmp-0 in nlIsZero\n"); 2151 dErrorBreak(); 2152 return TRUE; 2153 } 2154 return FALSE; 2155 #else 2140 2156 return (a==INT_TO_SR(0)); 2141 //return (mpz_cmp_si(a->z,(long)0)==0);2157 #endif 2142 2158 } 2143 2159 … … 2211 2227 number nlShort3_noinline(number x); 2212 2228 2213 static inline number nlInpAdd_(numbera, number b, const coeffs r)2229 LINLINE void nlInpAdd(number &a, number b, const coeffs r) 2214 2230 { 2215 2231 if (SR_HDL(a) & SR_HDL(b) & SR_INT) … … 2217 2233 LONG r=SR_HDL(a)+SR_HDL(b)-1L; 2218 2234 if ( ((r << 1) >> 1) == r ) 2219 return(number)(long)r;2235 a=(number)(long)r; 2220 2236 else 2221 returnnlRInit(SR_TO_INT(r));2237 a=nlRInit(SR_TO_INT(r)); 2222 2238 } 2223 2239 // a=a+b 2224 if (SR_HDL(b) & SR_INT)2240 else if (SR_HDL(b) & SR_INT) 2225 2241 { 2226 2242 switch (a->s) … … 2249 2265 } 2250 2266 } 2251 return a;2252 } 2253 if (SR_HDL(a) & SR_INT)2267 return; 2268 } 2269 else if (SR_HDL(a) & SR_INT) 2254 2270 { 2255 2271 number u=ALLOC_RNUMBER(); … … 2288 2304 } 2289 2305 nlTest(u, r); 2290 returnu;2306 a=u; 2291 2307 } 2292 2308 else … … 2357 2373 } 2358 2374 } 2359 nlTest(a, r); 2360 return a; 2361 } 2362 } 2363 2364 LINLINE void nlInpAdd(number &a, number b, const coeffs r) 2365 { 2366 a = nlInpAdd_(a, b, r); 2367 } 2368 2375 } 2376 nlTest(a, r); 2377 } 2369 2378 2370 2379 LINLINE number nlMult (number a, number b, const coeffs R)
Note: See TracChangeset
for help on using the changeset viewer.