3 ms·
Most cases I've seen accept anything as true as long as the LSB is 1, and quite strictly 0 as false. Everything else is up in the air. The value -1 is definitel
by kaetemi 7y ago
Most cases I've seen accept anything as true as long as the LSB is 1, and quite strictly 0 as false. Everything else is up in the air. The value -1 is definitely true. :)
- ufo 7y agoOne could say that -1 is the truest true, because its two's-complement representation has the most 1s.
- kaetemi 7y agoTrue.
- shakna 7y ago> The value -1 is definitely true Except when being used as a comparison to any of the std utilities.
- syockit 7y agoAs far as I know, std library specifically uses the word "nonzero" in the documentation to denote non-false value. Therefore you should be using !, &&, || for any boolean ops, but never == nor !=