I read this in a book and was just wondering how it works and if you would ever do something like that and for what reason you would do that. I understand you could return (x>y)
but why would you do false == (x > y)
?
It's just a more verbose way of writing
x <= y
The result of x > y
is evaluated and compared to false
. Since the result of x > y
is boolean, that's the same as writing
!(x > y) // an == true is implied here if you don't add it yourself
which of course is the same as writing
x <= y
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With