Live data from Hacker News

64-bit bank balances ‘ought to be enough for anybody’?

tigerbeetle.com

1–10 of 372 posts

Re: 64-bit bank balances ‘ought to be enough for anybody’?

#2
I’m a bit surprised that these two concepts are seen together. I’d of thought that financial math and data management would always be done with some level of abstraction so it doesn’t matter at all what your computer’s implementation is.

Then again, 128 bits is plenty for microcents or whatever the minimim unit is.

I’m guessing back in the day when things were 32 bit or less, there were entire financial database implementations that handled this abstraction?

Re: 64-bit bank balances ‘ought to be enough for anybody’?

#3
Perhaps I'm the odd one out here, but most financial systems I've had the chance to work with don't actually use numeric types to store values, they use strings or other comparable types. Numeric values are passed to all outside interfaces, but the internal states are written in a way where no bit level issues peddle with the values. I'm wondering what the experience of the wider audience here is?

Re: 64-bit bank balances ‘ought to be enough for anybody’?

#4

I’m a bit surprised that these two concepts are seen together. I’d of thought that financial math and data management would always be done with some level of abstraction so it doesn’t matter at all what your computer’s implementation is. Then again, 128 bits is plenty for microcents or whatever the minimim unit is. I’m guessing back in the day when things were 32 bit or less, there were entire financial database impl…

Handled in hardware on some machines (e.g. VAX)

Re: 64-bit bank balances ‘ought to be enough for anybody’?

#6

I’m a bit surprised that these two concepts are seen together. I’d of thought that financial math and data management would always be done with some level of abstraction so it doesn’t matter at all what your computer’s implementation is. Then again, 128 bits is plenty for microcents or whatever the minimim unit is. I’m guessing back in the day when things were 32 bit or less, there were entire financial database impl…

If you actually want to do something useful and accurate and auditable and performant and space-efficient, because you have a lot of money values to bank with, you really don't want too much abstraction.

My experiences in various bits of banking include where juniors ignore advice NOT to store currency in floating point values and then come whining that arithmetic is broken, and tech dudes in a lab deciding that every single FX flow in an investment bank should have 2MB of (unshared) calendar hidden inside its abstraction which made some individual trades too big to load even for powerful machines...

Fixed point calcs in integers are good.

Re: 64-bit bank balances ‘ought to be enough for anybody’?

#7

I’m a bit surprised that these two concepts are seen together. I’d of thought that financial math and data management would always be done with some level of abstraction so it doesn’t matter at all what your computer’s implementation is. Then again, 128 bits is plenty for microcents or whatever the minimim unit is. I’m guessing back in the day when things were 32 bit or less, there were entire financial database impl…

> I’m guessing back in the day when things were 32 bit or less, there were entire financial database implementations that handled this abstraction?

This issue is what COBOL was designed to solve. Fixed decimal point arithmetic in base 10

Re: 64-bit bank balances ‘ought to be enough for anybody’?

#8

I was under the impression that BCD was generally recommended for money, often because of (IEEE?) rounding and machine precision/epsilon: * https://en.wikipedia.org/wiki/Binary-coded_decimal * https://en.wikipedia.org/wiki/Machine_epsilon

no, integers are generally used. BCD is fixed-point in any case so it's just an inefficient integer representation.

Re: 64-bit bank balances ‘ought to be enough for anybody’?

#9

I was under the impression that BCD was generally recommended for money, often because of (IEEE?) rounding and machine precision/epsilon: * https://en.wikipedia.org/wiki/Binary-coded_decimal * https://en.wikipedia.org/wiki/Machine_epsilon

why add the complexity of bcd when you can just put in it units (e.g. cents) where there's no decimal point?

Re: 64-bit bank balances ‘ought to be enough for anybody’?

#10

I was under the impression that BCD was generally recommended for money, often because of (IEEE?) rounding and machine precision/epsilon: * https://en.wikipedia.org/wiki/Binary-coded_decimal * https://en.wikipedia.org/wiki/Machine_epsilon

I've never seen anyone use floating point for money in their bespoke applications
Post reply on HN