Mercurial > hg > octave-lyh
diff liboctave/oct-inttypes.h @ 6764:2a83fce5a097
[project @ 2007-06-27 19:02:59 by dbateman]
author | dbateman |
---|---|
date | Wed, 27 Jun 2007 19:02:59 +0000 |
parents | 7e958a1532c6 |
children | 93c65f2a5668 |
line wrap: on
line diff
--- a/liboctave/oct-inttypes.h +++ b/liboctave/oct-inttypes.h @@ -295,14 +295,17 @@ template <class T2> octave_int<T>& operator <<= (const T2& x) { - ival = ((ival << x) > std::numeric_limits<T>::max ()) ? 0 : (ival << x); + ival = ival << x; return *this; } template <class T2> octave_int<T>& operator >>= (const T2& x) { - ival >>= x; + if (ival < 0) + ival = - (((-ival) >> x) & std::numeric_limits<T>::max()); + else + ival = ival >> x; return *this; }