3 ms·
I’ve been involved with systems where 0xffff… was canonical “true”, but not something as specific as 7! If you’re going to turn on more bits, why not all of the
by wrs 3y ago
I’ve been involved with systems where 0xffff… was canonical “true”, but not something as specific as 7! If you’re going to turn on more bits, why not all of them? Though I think this was because the NOT instruction was used for logical inversion, so the bit flip theory doesn’t apply.
- cpeterso 3y agoFor example, the value of Visual Basic's "True" keyword is -1. This seems silly from the perspective of a C programmer, but -1 (0xffffffff) is "more true" than 1 because every bit is true, not just the LSB. :) https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/data-types/boolean-data-type https://learn.microsoft.com/en-us/dotnet/visual-basic/langua...
- bilekas 3y agoEven in VB there is a grain of rationale .. I never even considered before WHY it was -1.. I always just thought it was VB doing VB, but now I have gained +1 respect for Vb.. Edit: "Gained" no "Earned"
- marssaxman 3y agoIn the long-ago world where integers were commonly used as arrays of bit flags, it made perfect sense that True = Not False.
- layer8 3y agoThe OP still wanted to only type a single character.