Re: fast bit rotation
- Posted by "Juergen Luethje" <j.lue at gmx.de> Jan 01, 2004
- 444 views
Derek wrote: > ----- Original Message ----- > From: "jiri babor" > >> Thanks, guys, for your tremendous response. Tommy's machine code looks most >> promising. Currently I am looking at 24 bit integers, later I might even be >> forced beyond the Euphoria's 31-bit limit. So, sorry, look up tables and >> similar 8-bit solutions are interesting, but not of much practical use. > > Doesn't the INTEGER type only support 30-bit integers? I make the range > for INTEGER types to be from (-power(2,30)) to (power(2,30) - 1). It > seems that Euphoria uses 30-bits to hold the value, one bit to hold the > sign I think the sign bit must be counted, too. So 30 bits + 1 bit = 31 bits. If we add power(2,30) to both the minimum value and the maximum value that you mentioned above, that does not alter the range. Then we get an unsigned integer type from 0 to (power(2,31)-1. Now it's pretty clear, that the range consists of 31 bit. Whether or not one bit is used to hold the sign, is a different question, IMHO. > and the 32nd bit to hold the flag to tell if its an integer or > something else? Just guessing. <snip> Regards, Juergen -- /"\ ASCII ribbon campain | Money is the root of all evil. \ / against HTML in | Send 20 Dollars for more info. X e-mail and news, | / \ and unneeded MIME | http://home.arcor.de/luethje/prog/