use bitwise check instead of >= when number is small