in velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/MathUtils.java [243:268]
private static int findCalculationBase (Number op1, Number op2)
{
boolean op1Int = isInteger(op1);
boolean op2Int = isInteger(op2);
if ( (op1 instanceof BigDecimal || op2 instanceof BigDecimal) ||
( (!op1Int || !op2Int) && (op1 instanceof BigInteger || op2 instanceof BigInteger)) )
{
return BASE_BIGDECIMAL;
}
if (op1Int && op2Int) {
if (op1 instanceof BigInteger || op2 instanceof BigInteger)
{
return BASE_BIGINTEGER;
}
return BASE_LONG;
}
if ((op1 instanceof Double) || (op2 instanceof Double))
{
return BASE_DOUBLE;
}
return BASE_FLOAT;
}