public static NumberData $$min(NumberData arg0, NumberData arg1) { if (arg0 instanceof IntegerData && arg1 instanceof IntegerData) { return IntegerData.forValue(Math.min(arg0.integerValue(), arg1.integerValue())); } else { return FloatData.forValue(Math.min(arg0.numberValue(), arg1.numberValue())); } }
public static NumberData $$max(NumberData arg0, NumberData arg1) { if (arg0 instanceof IntegerData && arg1 instanceof IntegerData) { return IntegerData.forValue(Math.max(arg0.integerValue(), arg1.integerValue())); } else { return FloatData.forValue(Math.max(arg0.numberValue(), arg1.numberValue())); } } }
public static BooleanData $$lessThan(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return BooleanData.forValue(operand0.integerValue() < operand1.integerValue()); } else { return BooleanData.forValue(operand0.numberValue() < operand1.numberValue()); } }
public static NumberData $$round( NumberData valueData, @Nullable IntegerData numDigitsAfterPtData) { int numDigitsAfterPt = (numDigitsAfterPtData != null) ? numDigitsAfterPtData.integerValue() : 0 /* default */; if (numDigitsAfterPt == 0) { if (valueData instanceof IntegerData) { return valueData; } else { return IntegerData.forValue((int) Math.round(valueData.numberValue())); } } else if (numDigitsAfterPt > 0) { double value = valueData.numberValue(); double shift = Math.pow(10, numDigitsAfterPt); return FloatData.forValue(Math.round(value * shift) / shift); } else { double value = valueData.numberValue(); double shift = Math.pow(10, -numDigitsAfterPt); return IntegerData.forValue((int) (Math.round(value / shift) * shift)); } }
public static BooleanData $$lessThanOrEqual(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return BooleanData.forValue(operand0.integerValue() <= operand1.integerValue()); } else { return BooleanData.forValue(operand0.numberValue() <= operand1.numberValue()); } }
public static NumberData $$minus(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return IntegerData.forValue(operand0.integerValue() - operand1.integerValue()); } else { return FloatData.forValue(operand0.numberValue() - operand1.numberValue()); } }
public static BooleanData $$greaterThan(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return BooleanData.forValue(operand0.integerValue() > operand1.integerValue()); } else { return BooleanData.forValue(operand0.numberValue() > operand1.numberValue()); } }
public static NumberData $$times(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return IntegerData.forValue(operand0.integerValue() * operand1.integerValue()); } else { return FloatData.forValue(operand0.numberValue() * operand1.numberValue()); } }
public static BooleanData $$greaterThanOrEqual(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return BooleanData.forValue(operand0.integerValue() >= operand1.integerValue()); } else { return BooleanData.forValue(operand0.numberValue() >= operand1.numberValue()); } }