Finance
Implemented — financial numerics on synthetic data only
live under examples/13-finance/ and run byte-identically on both engines.
Nothing here stores real financial data or connects to any external system.
File |
Demonstrates |
|---|---|
|
Integer-penny compounding, year by year |
|
Annuity payment via iterated discount factor (no |
|
Net present value of a discounted cash-flow stream |
|
Weighted-average portfolio returns with exact integer weights |
Compound interest (excerpt)
func compound(start, years, percent) {
let amount = start
let year = 0
while (year < years) {
amount = amount + amount * percent / 100
year = year + 1
}
return amount
}
Run:
$ karkain run examples/13-finance/01_compound_interest.kark
Note
Float output prints at 6 significant figures on both engines; where exactness matters the examples use integer cents.
See also
Security — hashing and encoding used alongside finance demos in real applications.