logoalt Hacker News

amlutoyesterday at 4:49 PM4 repliesview on HN

If someone sells you 12345.55 EUR vs USD at a rate of 1.12345, how many EUR do you think you end up with? Do you think all market participants even agree? What if the rate is 1.123456?

For added fun, you can introduce division. Some systems will allow you to sell 12345.55 USD to buy EUR at a rate of 1.12345.

The article’s “no lost data” tenet is not really viable when this sort of division is involved. Are you going to track your account balance is a rational number with an absolutely immense denominator forever?


Replies

FabHKtoday at 3:27 PM

> If someone sells you 12345.55 EUR vs USD at a rate of 1.12345, how many EUR do you think you end up with?

1. If someone sells me 12345.55 EUR, I hope to end up with 12345.55 EUR.

2. That's the point though. They will sell you a certain amount of EUR at a certain dollar price. This, in turn, implies a rate (which might well have more than 5 digits behind the decimal). This is ideally close to the quoted rate, sure. But what counts is the actual EUR amount and the actual USD amount, not what rate was quoted or with how many digits.

dumahyesterday at 8:10 PM

Of course market participants agree?

Exchanges have calculation rules for every type of mark and payment and will always specify rounding.

SJC_Hackertoday at 6:14 AM

The only one who has to “agree” is the exchange. And it should be covered by the TOS

antonymooseyesterday at 7:18 PM

You store the sums on either end, the currencies, the exchange rate and the final sum? No one has .0000145 cents in their account. Rounding occurs in the real world.

show 1 reply