Mercurial > hg > octave-nkf
changeset 12084:bd994ce20158 release-3-2-x
pr-output.cc (set_format (const Complex&, int&, int&)): avoid passing NaN or Inf to log10
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 04 Sep 2009 06:59:44 +0200 |
parents | 2dbd6188b789 |
children | c5ab026894ef |
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. + 2008-09-01 David Bateman <dbateman@free.fr> * DLD-FUNCTIONS/eig.cc (Feigs): Correct nesting error in option
--- 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;