Port overflow fixes for daily interest and dividends; pay Modern dividends per manager
Daily interest and share dividends are computed in 64 bits before the division (ported from OpenBMH 1.0.3). In Modern each manager now receives the dividend of his own shares instead of the original's lost booking. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
f0979455d1
commit
9e92d07b03
10 files changed
+59
-62
No files matched your search
@@ -28,6 +28,15 @@ namespace bmh {
|
||||
// cleared for every manager.
|
||||
void daily_interest(GameState& g, WatcomRandom& rand);
|
||||
|
||||
// The day's interest of one account set. Products are widened to 64 bits before the
|
||||
// annual-rate division, so large balances cannot overflow; the truncation at each
|
||||
// division is kept. Positive = cost, negative = income.
|
||||
struct DailyInterestAmounts {
|
||||
int32_t borrowing = 0;
|
||||
int32_t cash_and_deposit = 0;
|
||||
};
|
||||
DailyInterestAmounts daily_interest_amounts(int32_t cash, int32_t deposit, int32_t credit);
|
||||
|
||||
} // namespace bmh
|
||||
|
||||
namespace bmh {
|
||||
|
||||
Reference in new issue
Block a user