diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-09-21 00:57:41 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-09-21 00:57:41 +0000 |
commit | 83accefd143a0e3ee8b3160d0927b3ff616743de (patch) | |
tree | f2fd3a56a446783f6e39069161a363429a676df7 /scipy/base/arrayprint.py | |
parent | d015bd082257ab85c6de46efbb5c7a5cc8cc88f9 (diff) | |
download | numpy-83accefd143a0e3ee8b3160d0927b3ff616743de.tar.gz |
added hashability of scalars, and fixed printing of large integers.
Diffstat (limited to 'scipy/base/arrayprint.py')
-rw-r--r-- | scipy/base/arrayprint.py | 7 |
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': |