/logical comparison/ int greater_abs(int num, int x){ return (num > x) || (num+x < 0); }
/squared approach/ int greater_abs2(int num, int x){ return num*num > x; }
See it by yourself, with (and without) optimizations: https://godbolt.org/
What would happen if x is a compile-time constant?