Method: Integer#|
- Defined in:
- numeric.c
permalink #|(other) ⇒ Integer
Bitwise OR; each bit in the result is 1 if either corresponding bit in self
or other
is 1, 0 otherwise:
"%04b" % (0b0101 | 0b0110) # => "0111"
Raises an exception if other
is not an Integer.
Related: Integer#& (bitwise AND), Integer#^ (bitwise EXCLUSIVE OR).
5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 |
# File 'numeric.c', line 5076
static VALUE
int_or(VALUE x, VALUE y)
{
if (FIXNUM_P(x)) {
return fix_or(x, y);
}
else if (RB_BIGNUM_TYPE_P(x)) {
return rb_big_or(x, y);
}
return Qnil;
}
|