End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Integer#nobits?
int.nobits?(mask) → true or false
numeric.c
View on GitHub ↗
static VALUE
int_nobits_p(VALUE num, VALUE mask)
{
mask = rb_to_int(mask);
return int_zero_p(rb_int_and(num, mask));
}
Returns true if no bits of +int+ & +mask+ are 1.