# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1181180961 21600
# Node ID 5ab27888269af2766f9e5b281c4d497a0d48b90c
# Parent  05b05aa4bdb52c1445c62517ab6d0d7a79e1c989
Fix bug that Thea Gegenberg reported in vectors mod n.

diff -r 05b05aa4bdb5 -r 5ab27888269a sage/ext/multi_modular.pyx
--- a/sage/ext/multi_modular.pyx	Mon Jun 04 23:53:06 2007 -0700
+++ b/sage/ext/multi_modular.pyx	Wed Jun 06 19:49:21 2007 -0600
@@ -32,7 +32,7 @@ ai = arith_llong()
 # Hard coded because currently matrix_modn_dense is implemented using C ints
 # which are always 32-bit.   Once this gets firxed, i.e., there is a better
 # matrix_modn class, then this can change.
-MAX_MODULUS = 46340
+MAX_MODULUS = 46341
 
 # TODO: have one global instance for sharing, copy for MutableMultiModularBasis
 cdef class MultiModularBasis_base:
diff -r 05b05aa4bdb5 -r 5ab27888269a sage/modules/vector_modn_dense.pxd
--- a/sage/modules/vector_modn_dense.pxd	Mon Jun 04 23:53:06 2007 -0700
+++ b/sage/modules/vector_modn_dense.pxd	Wed Jun 06 19:49:21 2007 -0600
@@ -1,6 +1,5 @@ cdef extern from "../ext/multi_modular.h
 cdef extern from "../ext/multi_modular.h":
     ctypedef unsigned long mod_int
-    mod_int MOD_INT_OVERFLOW
 
 cimport free_module_element
 import  free_module_element
diff -r 05b05aa4bdb5 -r 5ab27888269a sage/modules/vector_modn_dense.pyx
--- a/sage/modules/vector_modn_dense.pyx	Mon Jun 04 23:53:06 2007 -0700
+++ b/sage/modules/vector_modn_dense.pyx	Wed Jun 06 19:49:21 2007 -0600
@@ -78,7 +78,7 @@ from sage.structure.element cimport Elem
 
 cimport free_module_element
 
-MAX_MODULUS = MOD_INT_OVERFLOW
+from sage.ext.multi_modular import MAX_MODULUS
 
 cdef class Vector_modn_dense(free_module_element.FreeModuleElement):
     cdef _new_c(self):
diff -r 05b05aa4bdb5 -r 5ab27888269a sage/rings/integer_mod_ring.py
--- a/sage/rings/integer_mod_ring.py	Mon Jun 04 23:53:06 2007 -0700
+++ b/sage/rings/integer_mod_ring.py	Wed Jun 06 19:49:21 2007 -0600
@@ -96,7 +96,7 @@ def IntegerModRing(order=0):
     global _objsIntegerModRing
     if _objsIntegerModRing.has_key(order):
         x = _objsIntegerModRing[order]()
-        if x != None: return x
+        if not x is None: return x
     #if check_prime and arith.is_prime(order):
     #    R = sage.rings.finite_field.FiniteField_prime_modn(order)
     #else:
