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