Mercurial > hg > octave-terminal
changeset 11213:009d16b010fa
lo-mappers.cc (xmod, xrem): don't copy sign if result is zero
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 09 Nov 2010 13:21:15 -0500 |
parents | ce27d6f4e134 |
children | 7f19b2b6e093 |
files | liboctave/ChangeLog liboctave/lo-mappers.h |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2010-11-09 John W. Eaton <jwe@octave.org> + + * lo-mappers.h (xmod, xrem): Don't copy sign if result is zero. + 2010-11-09 John W. Eaton <jwe@octave.org> * lo-mappers.cc, lo-mappers.h (xisnan, xisinf, xfinite, xmod,
--- a/liboctave/lo-mappers.h +++ b/liboctave/lo-mappers.h @@ -346,7 +346,7 @@ retval = x - y * n; } - if (x != y && y != 0) + if (x != y && y != 0 && retval != 0) retval = xcopysign (retval, y); return retval; @@ -391,7 +391,7 @@ retval = x - y * n; } - if (x != y && y != 0) + if (x != y && y != 0 && retval != 0) retval = xcopysign (retval, x); return retval;