nx_card_rewards.nx
buildroot/runtime/nx_card_rewards.nx
about
nx_card_rewards.nx -- the REWARDS-vs-INTEREST engine (R2+R3 of the credit-card arm). Answers the operator's
exact ask: earn rewards on a real spend profile, then NET them against the interest you pay if you carry a
balance -- so a person can SEE whether the interest is eating the rewards. No-float, integer-exact cents;
composes nx_money (the same fixed-point interest math the ledger + debt engines use -- DRY, Cardinal 15).
A card is DATA (category rates in basis points + annual fee + sign-up terms), not hardcoded (Cardinal 11),
so it works for ANY card. NEVER-BRICK money analog (#26): pure functions, no side effects, no auto-anything --
this only COMPUTES + tells the truth; a human acts. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_money.nx
imported by: nx_card_adversary_gate.nxnx_card_rewards_gate.nx
structs
| none |
consts
| 9 | const K_MAGIC_10000: i64 = 10000 |
functions
| 15 | func cr_rewards_annual(sp: *i64, n: i64, reward_bps: *i64, n_rates: i64, base_bps: i64) -> i64 |
| 33 | func cr_point_bps(points_per_dollar_x100: i64, cents_per_point_x100: i64) -> i64 |
| 39 | func cr_signup_value(spend_in_window: i64, min_spend: i64, bonus: i64) -> i64 called by 1: main |
| 46 | func cr_interest_annual(avg_balance: i64, apr_pct_num: i64, apr_pct_den: i64) -> i64 |
| 53 | func cr_net_annual(rewards: i64, signup_first_year: i64, annual_fee: i64, interest: i64) -> i64 |
| 59 | func cr_breakeven_balance(rewards: i64, annual_fee: i64, apr_pct_num: i64, apr_pct_den: i64) -> i64 |
| 72 | func cr_verdict(net: i64, marginal_floor: i64) -> i64 |
| 80 | func cr_pick(net_a: i64, net_b: i64) -> i64 |