code: static Object[] promotePrimitives(Object lhs, Object rhs)
      {
          if ( Types.isNumeric(lhs) && Types.isNumeric(rhs) ) {
              Number lnum = promoteToInteger(lhs);
              Number rnum = promoteToInteger(rhs);
  
              if ( lhs instanceof BigDecimal ) {
                  if ( !(rhs instanceof BigDecimal) )
                      rhs = Primitive.castNumber(BigDecimal.class, rnum);
              } else if ( rhs instanceof BigDecimal ) {
                  lhs = Primitive.castNumber(BigDecimal.class, lnum);
              } else if ( Types.isFloatingpoint(lhs) || Types.isFloatingpoint(rhs)) {
                  if ( !(lhs instanceof Double) )
                      lhs = Double.valueOf(lnum.doubleValue());
                  if ( !(rhs instanceof Double) )
                      rhs = Double.valueOf(rnum.doubleValue());
              } else if ( lhs instanceof BigInteger ) {
                  if ( !(rhs instanceof BigInteger) )
                      rhs = Primitive.castNumber(BigInteger.class, rnum);
              } else if ( rhs instanceof BigInteger ) {
                  lhs = Primitive.castNumber(BigInteger.class, lnum);
              } else {
                  if ( !(lhs instanceof Long) )
                      lhs = Long.valueOf(lnum.longValue());
                  if ( !(rhs instanceof Long) )
                      rhs = Long.valueOf(rnum.longValue());
              }
          }
  
          return new Object[] { lhs, rhs };
      }
docs: Promote the pair of primitives to the maximum type of the two.
  e.g. [int,long]->[long,long]