Changeset 9cd697 in git


Ignore:
Timestamp:
Mar 21, 2011, 4:17:15 PM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
45159ae4c7be1c7c2ec22897b2201afc05c0a81f
Parents:
a8b44d7ae81df1f427913b6461535b6f2a111997
Message:
changed (corrected) nDivBy over 2^m

git-svn-id: file:///usr/local/Singular/svn/trunk@14023 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/rmodulo2m.cc

    ra8b44d r9cd697  
    208208}
    209209
    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 */
    213214BOOLEAN nr2mDivBy (number a, number b)
    214215{
     
    221222    {
    222223      /* overflow: we need to check whether b
    223          is a power of 2: */
     224         is zero or a power of 2: */
    224225      c = (NATNUMBER)b;
    225226      while (c != 0)
     
    232233  }
    233234  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  }
    235240}
    236241
Note: See TracChangeset for help on using the changeset viewer.