Re: System.Boolean Question.
"Tyrone Chou" <TyroneChou@MSN.Com> wrote in message
news:%23ME1hwLRGHA.4740@TK2MSFTNGP14.phx.gbl...[color=blue]
> hello, everybody.
>
> today, i read msdn like usual, suddenly i found variable with type of
> System.Boolean should take up 2 Bytes. it surprised me a lot. why a
> boolean value should take up 2 bytes? in my option, 1 bit should be ok:)
>[/color]
Well, a bit is out of the question. While it is nice space wise, accesing a
single bit is likely far more expensive than the additional few bits used to
store it. Space isn't everything.
Also, FWIW, I'm pretty sure the base boolean type is 4 bytes, because modern
procesors work with groups of 4 bytes better than they do with one.[color=blue]
>
> // code.
> if (value == ASC(0)) {
> return System.Boolean.FALSE;
> } else {
> return System.Boolean.TRUE;
> }[/color]
I don't see why this code is here. Did you have a question with regards to
it?