@Override public NumericConstant divide(NumericConstant c) { assertInstanceOf(c); return DoubleConstant.v(this.value / ((DoubleConstant) c).value); }
@Override public NumericConstant lessThan(NumericConstant c) { assertInstanceOf(c); return IntConstant.v(Double.compare(this.value, ((DoubleConstant) c).value) < 0 ? 1 : 0); }
@Override public NumericConstant subtract(NumericConstant c) { assertInstanceOf(c); return DoubleConstant.v(this.value - ((DoubleConstant) c).value); }
@Override public NumericConstant multiply(NumericConstant c) { assertInstanceOf(c); return DoubleConstant.v(this.value * ((DoubleConstant) c).value); }
@Override public NumericConstant remainder(NumericConstant c) { assertInstanceOf(c); return DoubleConstant.v(this.value % ((DoubleConstant) c).value); }
@Override public NumericConstant equalEqual(NumericConstant c) { assertInstanceOf(c); return IntConstant.v(Double.compare(this.value, ((DoubleConstant) c).value) == 0 ? 1 : 0); }
@Override public NumericConstant lessThanOrEqual(NumericConstant c) { assertInstanceOf(c); return IntConstant.v(Double.compare(this.value, ((DoubleConstant) c).value) <= 0 ? 1 : 0); }
@Override public NumericConstant add(NumericConstant c) { assertInstanceOf(c); return DoubleConstant.v(this.value + ((DoubleConstant) c).value); }
@Override public NumericConstant notEqual(NumericConstant c) { assertInstanceOf(c); return IntConstant.v(Double.compare(this.value, ((DoubleConstant) c).value) != 0 ? 1 : 0); }
@Override public NumericConstant greaterThan(NumericConstant c) { assertInstanceOf(c); return IntConstant.v(Double.compare(this.value, ((DoubleConstant) c).value) > 0 ? 1 : 0); }
@Override public NumericConstant greaterThanOrEqual(NumericConstant c) { assertInstanceOf(c); return IntConstant.v(Double.compare(this.value, ((DoubleConstant) c).value) >= 0 ? 1 : 0); }
@Override public IntConstant cmpl(RealConstant constant) { assertInstanceOf(constant); final double cValue = ((DoubleConstant) constant).value; if (this.value > cValue) { return IntConstant.v(1); } else if (this.value == cValue) { return IntConstant.v(0); } else { return IntConstant.v(-1); } }
@Override public IntConstant cmpg(RealConstant constant) { assertInstanceOf(constant); final double cValue = ((DoubleConstant) constant).value; if (this.value < cValue) { return IntConstant.v(-1); } else if (this.value == cValue) { return IntConstant.v(0); } else { return IntConstant.v(1); } }