22#include <drizzled/function/math/multiply.h>
34 double value= args[0]->val_real() * args[1]->val_real();
37 return fix_result(value);
44 int64_t value=args[0]->val_int()*args[1]->val_int();
57 val1= args[0]->val_decimal(&value1);
60 val2= args[1]->val_decimal(&value2);
62 (class_decimal_mul(E_DEC_FATAL_ERROR, decimal_value, val1,
69void Item_func_mul::result_precision()
72 if (result_type() == INT_RESULT)
73 unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag;
75 unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag;
77 decimals= min(args[0]->decimals + args[1]->decimals, DECIMAL_MAX_SCALE);
78 int precision= min(args[0]->decimal_precision() + args[1]->decimal_precision(),
79 (
unsigned int)DECIMAL_MAX_PRECISION);
80 max_length= class_decimal_precision_to_length(precision, decimals,unsigned_flag);
double real_op()
Performs the operation that this functions implements when the result type is REAL.
type::Decimal * decimal_op(type::Decimal *)
int64_t int_op()
Performs the operation that this functions implements when the result type is INT.
TODO: Rename this file - func.h is stupid.