Live data from Hacker News

Fixed – Fixed-place decimal math library for Go

github.com

11–20 of 73 posts

Re: Fixed – Fixed-place decimal math library for Go

#11
It's always struck me as strange than finance folk don't want correct math. They want math that matches the coins in their pocket.

If I am owed 2.575% on $3425956.57 for 245 months, why not get the correct sum instead of some rounded monthly sum added up? Its just strange.

Re: Fixed – Fixed-place decimal math library for Go

#12
post #8

Earlier quoted context omitted.

Despite what everyone says, I've spoken to several different people at several different highly-regarded banks who say that they do, in fact, use floating point for money amounts in some of their systems. What experience do people who work in banks have?

I work in Finance, I don't use float, and I suggest you never do either.

As a concrete example, someone was running a massive online FFI for predicting the value of derivatives, and they were doing it in the real domain and using doubles on GPUs for monetary values. Where they doing it 'wrong' then? I don't know much about finance myself.

Re: Fixed – Fixed-place decimal math library for Go

#13
post #8

Earlier quoted context omitted.

I work in Finance, I don't use float, and I suggest you never do either.

As a concrete example, someone was running a massive online FFI for predicting the value of derivatives, and they were doing it in the real domain and using doubles on GPUs for monetary values. Where they doing it 'wrong' then? I don't know much about finance myself.

If you are predicting, chances are you don't care about all the decimals being correct and you'd rather get the result quickly.

Re: Fixed – Fixed-place decimal math library for Go

#14

It's always struck me as strange than finance folk don't want correct math. They want math that matches the coins in their pocket. If I am owed 2.575% on $3425956.57 for 245 months, why not get the correct sum instead of some rounded monthly sum added up? Its just strange.

How would you pay such a non-integer sum?

Re: Fixed – Fixed-place decimal math library for Go

#15
post #8

Earlier quoted context omitted.

I work in Finance, I don't use float, and I suggest you never do either.

As a concrete example, someone was running a massive online FFI for predicting the value of derivatives, and they were doing it in the real domain and using doubles on GPUs for monetary values. Where they doing it 'wrong' then? I don't know much about finance myself.

Predicting a value is not the same as accounting.

Re: Fixed – Fixed-place decimal math library for Go

#16

It's always struck me as strange than finance folk don't want correct math. They want math that matches the coins in their pocket. If I am owed 2.575% on $3425956.57 for 245 months, why not get the correct sum instead of some rounded monthly sum added up? Its just strange.

How would you pay such a non-integer sum?

With a bank balance on a computer.

Re: Fixed – Fixed-place decimal math library for Go

#17

Earlier quoted context omitted.

As a concrete example, someone was running a massive online FFI for predicting the value of derivatives, and they were doing it in the real domain and using doubles on GPUs for monetary values. Where they doing it 'wrong' then? I don't know much about finance myself.

Predicting a value is not the same as accounting.

[deleted]

Re: Fixed – Fixed-place decimal math library for Go

#19

It's always struck me as strange than finance folk don't want correct math. They want math that matches the coins in their pocket. If I am owed 2.575% on $3425956.57 for 245 months, why not get the correct sum instead of some rounded monthly sum added up? Its just strange.

I always do my accounts exactly but then have to round up or down to make settlements. This can leave some "dust" in my accounts which I might eventually move to a losses account but I prefer to do things properly. For example, if I borrow money from someone I'll agree on an interest rate and calculate the interest (compounded continuously). If it turns out the interest is something like 1.01521 then I'll pay 1.02 and leave the account in the negative. I'll move it to losses if I never expect to transact with that entity again but if I do then things will work out exactly given enough time.
Post reply on HN