Example #1
0
 @Override
 public Value modulus(Value v) {
   ValueByte other = (ValueByte) v;
   if (other.value == 0) {
     throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL());
   }
   return ValueByte.get((byte) (value % other.value));
 }
Example #2
0
 private static ValueByte checkRange(int x) {
   if (x < Byte.MIN_VALUE || x > Byte.MAX_VALUE) {
     throw DbException.get(ErrorCode.NUMERIC_VALUE_OUT_OF_RANGE_1, Integer.toString(x));
   }
   return ValueByte.get((byte) x);
 }