Operators that work only on integers, like the bit-shifting operators, treat their arguments as numbers, except that BigDecimal
s and BigInteger
s are operated on as
BigInteger
s and all other kinds of numbers are operated on as Longs. For the BigInteger
case, the result of these operators remains a BigInteger
; for the
Long
case, the result is expressed as the same type of the arguments, if it fits, or as a Long
otherwise.