Re: [LinuxBIOS] Another dumb C question

2007-07-12 Thread Joseph Smith
Quoting Joseph Smith <[EMAIL PROTECTED]>: > Quoting Corey Osgood <[EMAIL PROTECTED]>: > >> Joseph Smith wrote: >>> Quoting Peter Stuge <[EMAIL PROTECTED]>: >>> >>> > value = 9 > > (2 << (value - 1)) > > >>> >>> Bit shift is fine methinks but I would suggest: (1 <

Re: [LinuxBIOS] Another dumb C question

2007-07-12 Thread Joseph Smith
Quoting Corey Osgood <[EMAIL PROTECTED]>: > Joseph Smith wrote: >> Quoting Peter Stuge <[EMAIL PROTECTED]>: >> >> value = 9 (2 << (value - 1)) >> >> >>> Bit shift is fine methinks but I would suggest: >>> >>> (1 << value) >>> >>> instead of >>> >>> (2 << (value - 1)) >>> >

Re: [LinuxBIOS] Another dumb C question

2007-07-12 Thread Corey Osgood
Joseph Smith wrote: > Quoting Peter Stuge <[EMAIL PROTECTED]>: > > >>> value = 9 >>> >>> (2 << (value - 1)) >>> >>> > > >> Bit shift is fine methinks but I would suggest: >> >> (1 << value) >> >> instead of >> >> (2 << (value - 1)) >> >> >> //Peter >> >> > Not sure I understand. I

Re: [LinuxBIOS] Another dumb C question

2007-07-12 Thread Joseph Smith
Quoting Peter Stuge <[EMAIL PROTECTED]>: > >> value = 9 >> >> (2 << (value - 1)) >> > Bit shift is fine methinks but I would suggest: > > (1 << value) > > instead of > > (2 << (value - 1)) > > > //Peter > Not sure I understand. I am trying to get 2 "to the power of" value. if value = 9 (1 << val

Re: [LinuxBIOS] Another dumb C question

2007-07-12 Thread Peter Stuge
On Thu, Jul 12, 2007 at 05:00:23AM -0400, Joseph Smith wrote: > Hello, > I have another newbie C question. > Is this the same as 2^9 ?? Note that ^ means XOR in C. Exclusive or. Output 1 when only one input bit is 1, but not both. 00100011 ^ 10101010 -- 10001001 > value = 9 > > (2

[LinuxBIOS] Another dumb C question

2007-07-12 Thread Joseph Smith
Hello, I have another newbie C question. Is this the same as 2^9 ?? value = 9 (2 << (value - 1)) This will give me 512, but will it work no matter what "value" is? Or does linuxbios already have a "to the power of" global function? Thanks - Joe -- linuxbios mailing list linuxbios@linuxbios.or