comparison liboctave/oct-inttypes.h @ 7503:8c32f95c2639

convert mapper functions to new format
author David Bateman <dbateman@free.fr>
date Wed, 20 Feb 2008 04:22:50 -0500
parents 4555c116b420
children 6f10bbb2854a
comparison
equal deleted inserted replaced
7502:2ce6b4258e96 7503:8c32f95c2639
312 if (ival < 0) 312 if (ival < 0)
313 ival = - (((-ival) >> x) & std::numeric_limits<T>::max()); 313 ival = - (((-ival) >> x) & std::numeric_limits<T>::max());
314 else 314 else
315 ival = ival >> x; 315 ival = ival >> x;
316 return *this; 316 return *this;
317 }
318
319 octave_int<T> abs (void) const
320 {
321 T val = value ();
322 if (val < static_cast <T> (0))
323 val = - val;
324 return val;
325 }
326
327 octave_int<T> signum (void) const
328 {
329 T val = value ();
330 if (val < static_cast <T> (0))
331 val = - static_cast <T> (1);
332 else if (val > static_cast <T> (0))
333 val = static_cast <T> (1);
334 return val;
317 } 335 }
318 336
319 octave_int<T> min (void) const { return std::numeric_limits<T>::min (); } 337 octave_int<T> min (void) const { return std::numeric_limits<T>::min (); }
320 octave_int<T> max (void) const { return std::numeric_limits<T>::max (); } 338 octave_int<T> max (void) const { return std::numeric_limits<T>::max (); }
321 339