divide method

Expr<T> divide(
  1. Decimal divisor, {
  2. required int scale,
  3. DecimalRounding rounding = DecimalRounding.exact,
})

Divides in SQL to an explicit scale without a floating-point intermediate.

Implementation

Expr<T> divide(
  Decimal divisor, {
  required int scale,
  DecimalRounding rounding = DecimalRounding.exact,
}) {
  Decimal.validateScale(scale);
  return Expr.internal(
    DecimalRatio(
      expressionNode,
      value(divisor, Codecs.decimal).expressionNode,
      scale,
      rounding,
    ),
    codec,
  );
}