// for gross:
// net - b = m * gross
// (net - b) / m = gross
- // and the calculate the inverse's bounds
const ms = table.map(([start, end, rate]) => 1 - rate);
const full_brackets = [0].concat(table.map(([start, end, rate]) => (end - start) * rate)).slice(0, table.length);
});
return function(net) {
for (const [start, end, m, b] of inverse_table) {
- if (start < net && net < end) {
+ if (start <= net && net <= end) {
return (net - b) / m;
}
}