Function break_infinity::afford_geometric_series[][src]

pub fn afford_geometric_series(
    resources_available: &Decimal,
    price_start: &Decimal,
    price_ratio: &Decimal,
    current_owned: &Decimal
) -> Decimal
Expand description

If you’re willing to spend ‘resourcesAvailable’ and want to buy something with exponentially increasing cost each purchase (start at priceStart, multiply by priceRatio, already own currentOwned), how much of it can you buy?

Adapted from Trimps source code.