summaryrefslogtreecommitdiff
path: root/scipy/base/arrayprint.py
diff options
context:
space:
mode:
Diffstat (limited to 'scipy/base/arrayprint.py')
-rw-r--r--scipy/base/arrayprint.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scipy/base/arrayprint.py b/scipy/base/arrayprint.py
index 0b0e561e1..4f4740682 100644
--- a/scipy/base/arrayprint.py
+++ b/scipy/base/arrayprint.py
@@ -312,8 +312,13 @@ def _digits(x, precision, format):
return precision-len(s)+zeros
+_MAXINT = sys.maxint
+_MININT = -sys.maxint-1
def _formatInteger(x, format):
- return format % x
+ if (x < _MAXINT) and (x > _MININT):
+ return format % x
+ else:
+ return "%s" % x
def _formatFloat(x, format, strip_zeros = 1):
if format[-1] == '3':