0

Is there any way to make equality operators (!=, ==) return in binary int rather than bool?

That is,

4 != 4

returns (bool) false, but I'd like to receive (int) 0.

The easiest way is to do a cast:

int(4 != 4),

but will this always work in general on all systems, independent of how they represent boolean quantities?

pretzlstyle
  • 2,774
  • 5
  • 23
  • 40

0 Answers0