Alternative to if statement in this simple example

if(metres >= 0) return true;
else return false;

Can I do this with one calculation? (ignoring the ternary operator)

+5
source share
2 answers
return (metres >= 0);
+11
source
return metres >= 0;
+6
source

All Articles