Scale creates an expression that scales another expression by a constant factor, rounding up. Factors are constant so that a model's runtime charge depends only on the sizes reported by the sizing strategy. A cost which differs by argument type should be modeled with one OverloadModel per overload
(expr QuantityExpr, factor float64)
| 758 | // exactly 1/10, and the product is computed exactly; an unbounded quantity stays unbounded; and |
| 759 | // when a model is compiled, factors are moved outward so that each product is rounded once. |
| 760 | func Scale(expr QuantityExpr, factor float64) QuantityExpr { |
| 761 | return scaleExpr{expr: expr, factor: factor, rat: rationalOf(factor)} |
| 762 | } |
| 763 | |
| 764 | // Square creates an expression representing the square of another expression. |
| 765 | func Square(expr QuantityExpr) QuantityExpr { |