Made calculateMaxAffordable, calculateCost, and cost requirements interface a bit cleaner #17

Merged
thepaperpilot merged 6 commits from feature/requirements-refactor into main 2023-05-17 23:52:28 +00:00
Showing only changes of commit 500e412fdb - Show all commits

View file

@ -399,7 +399,7 @@ export function integratePow10(stack: SubstitutionStack, lhs: FormulaSource) {
export function invertPowBase(value: DecimalSource, lhs: FormulaSource, rhs: FormulaSource) {
if (hasVariable(lhs)) {
return lhs.invert(Decimal.ln(value).div(unrefFormulaSource(rhs)));
return lhs.invert(Decimal.ln(value).div(Decimal.ln(unrefFormulaSource(rhs))));
} else if (hasVariable(rhs)) {
return rhs.invert(Decimal.root(unrefFormulaSource(lhs), value));
}