Mercurial > hg > octave-lyh
changeset 8029:090001c04619
initialization check for correct NaN sign
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 12 Aug 2008 10:54:31 -0400 |
parents | f0fbf47c914c |
children | c42ba026faf1 |
files | liboctave/ChangeLog liboctave/lo-ieee.cc |
diffstat | 2 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2008-08-12 Jaroslav Hajek <highegg@gmail.com> + + * lo-ieee.cc (octave_ieee_init): Try to ensure that octave_NaN is + classified as positive by lo_ieee_signbit. + 2008-08-11 Jaroslav Hajek <highegg@gmail.com> * Array.cc (no_op_fcn): New static function.
--- a/liboctave/lo-ieee.cc +++ b/liboctave/lo-ieee.cc @@ -95,6 +95,10 @@ octave_NaN = (*(X_CAST(double *, DQNAN))); #else octave_NaN = tmp_inf / tmp_inf; + // try to ensure that lo_ieee_sign gives false for a NaN. + if (lo_ieee_signbit (octave_NaN)) + octave_NaN = -octave_NaN; + #endif octave_Inf = tmp_inf;