Mercurial > hg > octave-thorsten
changeset 11397:57868a21170e
lo-mappers.h (xrem, xmod): prevent use of extra precision
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 20 Dec 2010 02:19:04 -0500 |
parents | 7b563cf94d8d |
children | f1a4db353da5 |
files | liboctave/ChangeLog liboctave/lo-mappers.h |
diffstat | 2 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2010-12-20 John W. Eaton <jwe@octave.org> + + * lo-mappers.h (xrem, xmod): Declare temporary result from + multiplication volatile. + 2010-12-15 John W. Eaton <jwe@octave.org> Bug #31883.
--- a/liboctave/lo-mappers.h +++ b/liboctave/lo-mappers.h @@ -341,7 +341,10 @@ } } - retval = x - y * n; + // Prevent use of extra precision. + volatile T tmp = y * n; + + retval = x - tmp; } if (x != y && y != 0 && retval != 0) @@ -386,7 +389,10 @@ } } - retval = x - y * n; + // Prevent use of extra precision. + volatile T tmp = y * n; + + retval = x - tmp; } if (x != y && y != 0 && retval != 0)