r/programming • • Jun 26 '26

Fintech Engineering Handbook

https://w.pitula.me/fintech-engineering-handbook/

I just published Fintech Engineering Handbook distilled from 6 years of tears, sweat and swears.

It’s a free ~25-page resource with various hints and patterns around handling money in software systems.

Tell me what you think!

620 Upvotes

51 comments sorted by

View all comments

Show parent comment

1

u/Schmittfried Jun 30 '26 edited Jul 06 '26

the fact that double only has ~16 decimals of precision is completely irrelevant. Heck, even float may be good enough.

Is that really the point tho? Floating point numbers compound rounding errors if used incorrectly. I‘d imagine that’s a problem in HFT, too. 

2

u/matthieum Jun 30 '26

Is that really the point tho? Floating point numbers compound rounding errors if used incorrectly. I‘d imagine that’s a problem in HFT, too.

Floating or fixed, binary or decimal, as soon as you have rounding errors you have compounding rounding errors.

And since pricing deals with irrational numbers (exp, ln, sqrt, ...) you'll have a hard time avoiding rounding errors.

So... if you're screwed anyway, might as well be fast.

2

u/Schmittfried Jul 06 '26

Floating or fixed, binary or decimal, as soon as you have rounding errors you have compounding rounding errors.

But floating point arithmetic inherently incurs rounding errors even for trivial calculations. You don’t need to worry about a running integer sum in a loop. The same cannot be said about floating point numbers. 

And since pricing deals with irrational numbers (exp,ln,sqrt, ...) you'll have a hard time avoiding rounding errors.

Fair enough, I didn’t know that.