O
One Handed Man \( OHM - Terry Burns \)
No, it is stored as a +1 one the stack.
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
Cablewizard said:Additionally, by storing the Boolean value as all 1's or all 0's, you get an
additional performance gain when dealing with IO, as you can ignore the Byte
Ordering (Little/Middle/Big Endean). 1111 = 1111 forward or backward.
IF you did have a 1 Bit signed integer type, if the value was not 0, it would
be -1 (or -0, but that's a discussion for another day)
A Boolean evaluation of an expression is actually a double negative.
If an expression does not evaluate to False(0), then it must be True. So all non
zero values are True.
Cablewizard said:Additionally, by storing the Boolean value as all 1's or all 0's, you get an
additional performance gain when dealing with IO, as you can ignore the Byte
Ordering (Little/Middle/Big Endean). 1111 = 1111 forward or backward.
IF you did have a 1 Bit signed integer type, if the value was not 0, it would
be -1 (or -0, but that's a discussion for another day)
A Boolean evaluation of an expression is actually a double negative.
If an expression does not evaluate to False(0), then it must be True. So all non
zero values are True.
Cablewizard said:Agreed. I haven't investigated the actual implementation in dotNet or the other
various languages.
This has become more about the mechanics of it all as opposed to the
implementation.
Although if one was to ask me to guess what the implementation would have been,
my guess would not have been +1.
So I do find the actual implementation to be interesting.
In the end, I think Greg deserves the vote for the "best" answer.
FALSE = 0
TRUE = !FALSE
But as it turns out, how you actually implement that can vary.
Gerald
There are 10 kinds of people in the world.
Those that understand Binary, and those that do not.
(oldie but goodie, and appropriate here)
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
Cablewizard said:In the end, I think Greg deserves the vote for the "best" answer.
FALSE = 0
TRUE = !FALSE
So 11111111 = -1 in a Signed Byte
In an Unsigned Byte, it would be 255