func (d Decimal) Div(d2 Decimal) Decimal {
	dec := Decimal{decimal: d.decimal.Div(d2.decimal)}

	var vars, formula string
	if d.parens {
		vars += leftParen + d.vars + rightParen + div
		formula += leftParen + d.formula + rightParen + div
	} else {
		vars += d.vars + div
		formula += d.formula + div
	}

	if d2.parens {
		vars += leftParen + d2.vars + rightParen
		formula += leftParen + d2.formula + rightParen
	} else {
		vars += d2.vars
		formula += d2.formula
	}

	dec.vars = vars
	dec.formula = formula

	return dec
}
// Div returns d / d2. If it doesn't divide exactly, the result will have
// DivisionPrecision digits after the decimal point.
Div returns d / d2. If it doesn't divide exactly, the result will have
DivisionPrecision digits after the decimal point.
// Div returns d / d2 . If it doesn ' t divide exactly the result will have // DivisionPrecision digits after the decimal point .
func (d Decimal) Div(d2 Decimal) Decimal {
	dec := Decimal{decimal: d.decimal.Div(d2.decimal)}
	var vars, formula string
	if d.parens {
		vars += leftParen + d.vars + rightParen + div
		formula += leftParen + d.formula + rightParen + div
	} else {
		vars += d.vars + div
		formula += d.formula + div
	}
	if d2.parens {
		vars += leftParen + d2.vars + rightParen
		formula += leftParen + d2.formula + rightParen
	} else {
		vars += d2.vars
		formula += d2.formula
	}
	dec.vars = vars
	dec.formula = formula
	return dec
}
func ( d Decimal ) Div ( d2 Decimal ) Decimal { dec := Decimal { decimal : d . decimal . Div ( d2 . decimal ) } var vars , formula string if d . parens { vars += leftParen + d . vars + rightParen + div formula += leftParen + d . formula + rightParen + div } else { vars += d . vars + div formula += d . formula + div } if d2 . parens { vars += leftParen + d2 . vars + rightParen formula += leftParen + d2 . formula + rightParen } else { vars += d2 . vars formula += d2 . formula } dec . vars = vars dec . formula = formula return dec }
Div returns d / d2.
Div returns d / d2 .