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