Changeset 9cd697 in git
- Timestamp:
- Mar 21, 2011, 4:17:15 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 45159ae4c7be1c7c2ec22897b2201afc05c0a81f
- Parents:
- a8b44d7ae81df1f427913b6461535b6f2a111997
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/rmodulo2m.cc
ra8b44d r9cd697 208 208 } 209 209 210 /* This does not seem to be the predicate whether a 211 is divisible by b in Z/2^m: if a is NULL then 212 the answer is not necessarily TRUE. */ 210 /* Is a divisible by b? There are two cases: 211 1) a = 0 mod 2^m; then TRUE iff b = 0 or b is a power of 2 212 2) a, b <> 0; then TRUE iff b/gcd(a, b) is a unit mod 2^m 213 TRUE iff b(gcd(a, b) is a unit */ 213 214 BOOLEAN nr2mDivBy (number a, number b) 214 215 { … … 221 222 { 222 223 /* overflow: we need to check whether b 223 is a power of 2: */224 is zero or a power of 2: */ 224 225 c = (NATNUMBER)b; 225 226 while (c != 0) … … 232 233 } 233 234 else 234 return ((NATNUMBER)a % (NATNUMBER)b) == 0; 235 { 236 number n = nr2mGcd(a, b, currRing); 237 n = nr2mDiv(b, n); 238 return nr2mIsUnit(n); 239 } 235 240 } 236 241
Note: See TracChangeset
for help on using the changeset viewer.