Modern financial technology interfaces increasingly offload real-time
computational workloads to client-side runtimes. However, execution
environments built on standard ECMAScript engines rely on IEEE-754
double-precision floating-point arithmetic, which introduces
non-deterministic representation drift in fractional calculations. In
statutory accounting, compounding debt repayment models, and
high-frequency digital ledgers, this drift compounds non-linearly
across time horizons, violating basic audit trail reconciliation
standards.
This paper specifies the computational architecture of
FinEngine, an open-source, non-commercial
deterministic mathematical library developed under the Centre for
Fintech and Strategic Business Research (CFSBR). FinEngine implements
an integer-scaled monetary sub-unit arithmetic model, formalizes
localized currency primitives for emerging markets—specifically
the Bangladeshi Taka (BDT) and its atomic sub-unit (Poisha)—and
introduces zero-knowledge, 100% client-side calculation pipelines for
loan amortization schedules, internal rate of return (XIRR) solvers,
and debt-burden stress testing.
The Numerical Pathology of Client-Side Web Runtimes
1.1 IEEE-754 binary64 Floating-Point Drift
ECMAScript standardizes numerical calculation on the IEEE-754
double-precision floating-point format (binary64).
Numbers are allocated 64 bits of storage divided into three discrete
fields:
Field
Bits
Description
s
1
Sign bit: 0 = positive, 1 = negative
e
11
Biased exponent (bias = 1023)
m
52
Fraction/Significand (53 bits with implicit leading 1)
Under this schema, numbers are evaluated as:
V = (-1)s × (1.m)2 × 2e - 1023
(1.1)
Because fractional values are expressed as sums of negative powers of
two (2-1 = 0.5, 2-2 = 0.25, 2-3 =
0.125, etc.), common decimal fractions cannot be represented exactly
in finite base-2 expansion. For example, the decimal fractions 0.1
(1/10) and 0.2 (1/5) result in infinite repeating binary fractions:
Evaluating simple addition in JavaScript yields the well-documented
anomaly:
0.1 + 0.2 = 0.30000000000000004 ≠ 0.3
(1.4)
1.2 Compounding Propagation in Loan Amortization
While fractional variance on the order of O(10-17) is
negligible in graphical rendering or casual statistics, it is
catastrophic in recursive financial operations. Consider a
reducing-balance loan schedule over n periods, where the outstanding
balance Bt is defined by the recurrence relation:
Bt = Bt-1(1 + r) - EMI
(1.5)
When evaluated under floating-point arithmetic, each iteration t ∈ {1,
…, n} accumulates representation drift εt:
Bt* = Bt + ∑k=1t εk (1 + r)t-k
(1.6)
In multi-year amortization schedules (n ≥ 60 months), cumulative
rounding drift ε causes the closing terminal balance Bn to
fail to liquidate cleanly to zero (Bn ≠ 0.00). In statutory
double-entry bookkeeping, a balance of +0.02 or -0.01 breaks immutable
ledger parity, triggers audit violations, and complicates closing
reconciliation.
Section 2
The Deterministic Arithmetic Framework
FinEngine eliminates binary floating-point drift through an
integer-scaled monetary sub-unit arithmetic model that avoids
arbitrary third-party runtime dependencies.
Raw Monetary Input (V)
↓
Scale: Vscaled = round(V × 10k)
↓
Integer Sub-Unit Space (Poisha)|Vscaled| ≤ 253 - 1
↓
Core Math Ops: +, -(Exact Integer Space)
Ratio & Division Matrix(Banker's Rounding)
↓
Terminal ReconciliationSum(Pt) === Principal
↓
Zero-Drift Ledger Output(Bn === 0.00)
Figure 1: Integer-scaled sub-unit arithmetic flow for deterministic
ledger reconciliation.
2.1 Integer Sub-Unit Scaling
FinEngine represents all currency balances strictly as integer
quantities of the currency's smallest statutory atomic unit. For the
Bangladeshi Taka (BDT), the smallest atomic unit is the Poisha (1 BDT
= 100 Poisha).
Definition 2.1: Atomic Poisha Scaling Mapping
The transformation bijection f: ℚ → ℤ is formalized as:
Vscaled = ⌊ V · 10k + 1/2 sgn(V) ⌋
(2.1)
Where:
V is the decimal monetary value.
k is the currency scale exponent (k = 2 for BDT).
sgn(V) preserves directional signs.
All internal intermediate computations (addition, subtraction, and
discrete balance tracking) execute entirely within the closed domain
of integers (ℤ).
2.2 Numerical Safety Boundaries
To maintain execution performance across all client engines without
forced polyfills, FinEngine operates within the native ECMAScript safe
integer boundary:
Any arithmetic transaction or ledger verification projected to exceed
253 - 1 triggers a deterministic boundary exception
(SafeIntegerOverflowException) rather than decaying
silently into floating-point approximation.
2.3 Deterministic Rounding Specifications
When division or compound multiplication leaves the integer domain,
FinEngine employs Half-Away-From-Zero (Symmetric Rounding) for
consumer-facing installment calculations, or Half-To-Even (Banker's
Rounding / IEEE-754 default) for balanced institutional ledgers to
prevent positive cumulative drift over large sample sizes.
In contrast to flat-rate interest calculations—which obscure
actual borrowing costs and understate the effective annual
rate—FinEngine enforces the actuarial reducing-balance annuity
model:
EMI = P · [r(1 + r)n] / [(1 + r)n - 1]
(3.1)
Variable
Type
Definition
P
Integer (ℤ)
Principal loan amount in integer poisha (P = Principal × 100)
r
Decimal (ℚ)
Periodic monthly rate: r = Annual Rate / 1200
n
Integer (ℕ)
Total repayment months (n ≥ 1)
3.2 Discrete Iteration and Periodic Partitioning
For every discrete installment period t ∈ {1, 2, …, n}, the engine
derives periodic interest accrual (It), principal
liquidation (Pt), and closing balance (Bt) via
strict integer truncation rules:
It = round(Bt-1 · r)
Pt = EMI - It
Bt = Bt-1 - Pt
(3.2)
Where B0 = P.
3.3 The Terminal Reconciliation Rule
Because discrete interest rounding rounds periodic values to the
nearest whole poisha, the sum of principal portions naturally drifts
from the starting principal by small integer amounts (± Δ poisha):
∑t=1n Pt ≠ P
(3.3)
Theorem 3.1: The Terminal Reconciliation Rule & Zero-Drift
Closure
FinEngine resolves periodic drift through the Terminal
Reconciliation Rule. In the final payment period (t = n):
Pn = Bn-1
EMIn = Pn + In
Bn = Bn-1 - Pn ≡ 0
(3.4)
This deterministic boundary constraint guarantees that the closing
principal balance terminates identically at zero (Bn ≡
0), completely preventing trailing poisha discrepancies in audited
accounting ledgers.
Section 4
Advanced Solvers and Actuarial Engines
4.1 Internal Rate of Return (XIRR) Solver
For non-periodic, non-uniform digital transactions (such as merchant
cash advances and micro-installments), FinEngine solves for internal
rate of return via the generalized net present value relation:
NPV(R) = ∑i=1m Ci / (1 + R)(di - d0)/365
= 0
(4.1)
Where:
Ci is the cash flow at date di.
d0 is the initial disbursement timestamp.
R is the annualized discount factor.
Because closed-form solutions do not exist for m > 4, FinEngine uses a
constrained Newton-Raphson root-finding iteration coupled with binary
bisection fallbacks:
Rk+1 = Rk - NPV(Rk) /
NPV'(Rk)
(4.2)
Convergence Threshold: |Δ R| < 10-7
Iteration Cap: Maximum 100 iterations. If
convergence fails due to sign stagnation, the engine switches to
bounded Brent-Dekker root bracketing, preventing runaway client CPU
usage.
4.2 Debt-Burden Ratio (DBR) Stress Testing
To prevent predatory micro-lending and ensure compliance with central
banking guidelines on responsible consumer lending,
@finengine/math evaluates localized debt burden limits:
@finengine/uiUI Micro-Components · Schedule and KPI Display
↓
X (Zero-Network Egress)
Figure 2: Zero-network client-side execution pipeline for financial
telemetry privacy.
Zero-Knowledge Computation: Financial calculations
execute entirely within the local host runtime (V8, SpiderMonkey,
JavaScriptCore). No raw loan values, salaries, or accounting data
cross the network boundary.
Offline-First Reliability: The engine runs without
external API handshakes, keeping loan assessments, installment
schedules, and merchant reconciliations fully operational in
low-bandwidth or offline environments.
Section 6
Monorepo Surface and Emerging Markets Roadmap
Package
Description
@finengine/core
Integer conversion, arithmetic primitives, BDT localized
formatting (3-2-2 South Asian grouping: 1,00,000.00), and
double-entry ledger balance checks.
@finengine/math
Amortization schedule builders, terminal balancing logic, XIRR
and APR algorithms, and affordability metrics.
@finengine/ui
Accessible, unstyled React/TypeScript UI elements for
financial schedules, repayment summaries, and debt ratio
gauges.
Emerging Market Research Roadmap (CFSBR Lab Pipeline)
Package
Description
@finengine/risk
Localized algorithmic scoring matrices for informal and
thin-file borrowers using alternative cash-flow data.
@finengine/microfinance
Actuarial translation modules converting flat interest
marketing structures into true reducing APR for borrower
protection and regulatory transparency.
@finengine/ratios
Deterministic financial ratio engines covering working capital
liquidity, cash runway projections, and full DuPont statement
decomposition.
@finengine/markets
Capital market return helpers and portfolio variance tools.
@finengine/tax
NBR-compliant TDS/VDS and salary tax calculation primitives.
Section 7 · Academic Citation
Cite FinEngine
FinEngine is maintained as open computational infrastructure under the
Centre for Fintech and Strategic Business Research (CFSBR). To cite
this methodology in academic papers, theses, policy briefs, or
technical documentation:
APA 7th Edition
Rafi, M. G. M. (2026).
FinEngine: A Deterministic Computational Framework for Client-Side
Financial Interfaces
(CFSBR Technical Working Paper No. CFSBR-FE-2026-001). Centre for
Fintech and Strategic Business Research.
https://doi.org/10.67226/cfsbr.fe.2026.001.v1
BibTeX Entry (Working Paper)
@techreport{rafi2026finengine,
author = {Rafi, Md Golam Mubasshir},
title = {FinEngine: A Deterministic Computational Framework for Client-Side Financial Interfaces},
institution = {Centre for Fintech and Strategic Business Research (CFSBR)},
year = {2026},
month = {September},
type = {Technical Working Paper},
number = {CFSBR-FE-2026-001},
doi = {10.67226/cfsbr.fe.2026.001.v1},
url = {https://finengine.js.org/methodology/}
}
Software Archive Citation (Zenodo)
@software{finengine_core_v030,
author = {Rafi, Md Golam Mubasshir},
title = {gmrafi/FinEngine: FinEngine v0.3.0: The Deterministic Financial Engine Release},
year = {2026},
publisher = {Zenodo},
version = {v0.3.0},
doi = {10.5281/zenodo.22769502},
url = {https://doi.org/10.5281/zenodo.22769502}
}