# HG changeset patch
# User J. H. Palmieri <palmieri@math.washington.edu>
# Date 1234716672 28800
# Node ID d0d8a499458729a1c1e380ad56be107275f07d81
# Parent  038b84f34083060e79bdfa442493d1b56314b2a3
change error message for integer matrices which are too big (#5273)

diff -r 038b84f34083 -r d0d8a4994587 sage/matrix/matrix_space.py
--- a/sage/matrix/matrix_space.py	Wed Feb 11 00:01:24 2009 -0800
+++ b/sage/matrix/matrix_space.py	Sun Feb 15 08:51:12 2009 -0800
@@ -197,7 +197,7 @@
         sage: MatrixSpace(ZZ,10,2^31)
         Traceback (most recent call last):                                   # 32-bit
         ...                                                                  # 32-bit
-        ValueError: number of rows and columns must be less than 2^31 (on a 32-bit computer -- use a 64-bit computer for bigger matrices)    # 32-bit
+        ValueError: number of rows and columns must be less than 2^31 (on a 32-bit computer -- use a 64-bit computer for matrices with up to 2^63-1 rows and columns)           # 32-bit
         Full MatrixSpace of 10 by 2147483648 dense matrices over Integer Ring   # 64-bit
     """
     def __init__(self,  base_ring,             
@@ -215,12 +215,10 @@
         if ncols < 0:
             raise ArithmeticError, "ncols must be nonnegative"
 
-        if sage.misc.misc.is_64_bit:
-            if nrows >= 2**63 or ncols >= 2**63:
-                raise ValueError, "number of rows and columns must be less than 2^63"
-        else:
-            if nrows >= 2**31 or ncols >= 2**31:
-                raise ValueError, "number of rows and columns must be less than 2^31 (on a 32-bit computer -- use a 64-bit computer for bigger matrices)"
+        if nrows >= 2**63 or ncols >= 2**63:
+            raise ValueError, "number of rows and columns must be less than 2^63"
+        elif nrows >= 2**31 or ncols >= 2**31 and not sage.misc.misc.is_64_bit:
+            raise ValueError, "number of rows and columns must be less than 2^31 (on a 32-bit computer -- use a 64-bit computer for matrices with up to 2^63-1 rows and columns)"
             
         self.__nrows = nrows
         self.__is_sparse = sparse
