Mercurial > hg > octave-lojdl
changeset 9611:6f42ea240b3a
pr-output.cc (set_format (const Complex&, int&, int&)): avoid passing NaN or Inf to log10
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 03 Sep 2009 17:28:58 -0400 |
parents | bb36a5730ecc |
children | 66970dd627f6 |
files | src/ChangeLog src/pr-output.cc |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-09-03 John W. Eaton <jwe@octave.org> + + * pr-output.cc (set_format (const Complex&, int&, int&)): + Avoid passing NaN or Inf to log10. + 2009-09-03 Jaroslav Hajek <highegg@gmail.com> * ov.cc (octave_value::assign (assign_op, const octave_value&)):
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -852,10 +852,10 @@ double r_abs = rp < 0.0 ? -rp : rp; double i_abs = ip < 0.0 ? -ip : ip; - int r_x = r_abs == 0.0 + int r_x = (xisinf (rp) || xisnan (rp) || xr_abs == 0.0) ? 0 : static_cast<int> (floor (log10 (r_abs) + 1.0)); - int i_x = i_abs == 0.0 + int i_x = (xisinf (ip) || xisnan (ip) || i_abs == 0.0) ? 0 : static_cast<int> (floor (log10 (i_abs) + 1.0)); int x_max, x_min;