summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-05-22 23:12:03 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-05-22 23:12:03 +0000
commit74057dee709fe3e48d24f5afabd3ffb5ffc72888 (patch)
tree50d2679437e80626712142c1b34591d2b186c3ed /numpy/core/arrayprint.py
parent0a1fa4dc3210882133be19e7d93fd50169673de1 (diff)
downloadnumpy-74057dee709fe3e48d24f5afabd3ffb5ffc72888.tar.gz
Fix ticket #501 which caused some array printing problems
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r--numpy/core/arrayprint.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
index ea91a0a86..d47180e4f 100644
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -344,6 +344,7 @@ def _formatArray(a, format_function, rank, max_line_len,
def _floatFormat(data, precision, suppress_small, sign = 0):
exp_format = 0
+ errstate = _gen.seterr(all='ignore')
non_zero = _uf.absolute(data.compress(_uf.not_equal(data, 0)))
##non_zero = _numeric_compress(data) ##
if len(non_zero) == 0:
@@ -357,6 +358,7 @@ def _floatFormat(data, precision, suppress_small, sign = 0):
if not suppress_small and (min_val < 0.0001
or max_val/min_val > 1000.):
exp_format = 1
+ _gen.seterr(**errstate)
if exp_format:
large_exponent = 0 < min_val < 1e-99 or max_val >= 1e100
max_str_len = 8 + precision + large_exponent