Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So does this mean bool true = 3 or should bool true = 5?

This will bloat the code a bit.



Interesting. Seems like software could be made a notch more robust by encoding true and false with a larger number of bit differences.


The canonical Boolean values in FORTH are 0 and -1 (that is, all bits set). IIRC the point of that is to unify the bitwise and logical operators, though, not detect bitflips.

Also, at the machine code level, a Boolean controlling a branch or a while loop often doesn't ever make it out of the flags register, where it'll only be a single bit anyway because that's how the hardware works. Not really changeable in software.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: