|
From: | Daniel J Sebald |
Subject: | Re: bitshift of int8, int16, etc? |
Date: | Mon, 25 Jun 2007 16:40:34 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 |
David Bateman wrote:
Daniel J Sebald wrote:David Bateman wrote:This is the standard behavior of an arithmetic shift.. See http://en.wikipedia.org/wiki/Arithmetic_shiftI looked at that reference yesterday. OK, good then.Ok, saturation might make sense. My preference was or an arithmetic shift as a shift operator that had a clear and documented functionality.DSP chips often have a control register with a bit to change such behavior, i.e. wrap or saturate.Hey I know, I did write a fixed point type :-) ....
Oh, that's right, Motorola. Got a few books lying around from them...
Do we need to know the overflow of each and every element,
I would think so. Seems the logical thing to do, if anything.
or just that an overflow occurred? I'd thought more the second case and then just have warning ("Octave:bitshift_overflow", "on") to enable the warning if desired. The fact is that as matlab doesn't implement this yet, whatever we choose to do will be wrong in any case and need modifying in the long run. So simple is probably better..
Until then can live wild and free. Dan
[Prev in Thread] | Current Thread | [Next in Thread] |