Re:Copilot regurgitating Quake code, including sweary comments
by bidirectional on Friday July 02, 2021 @10:05AM
(#27711666)
Every front office finance project I have ever worked on has used floating point, so take the dogma with a grain of salt. It depends entirely on the context.
[ Parent
| on HN ]
Re:Copilot regurgitating Quake code, including sweary comments
by jhugo on Friday July 02, 2021 @10:13AM
(#27711768)
They probably just accumulate the rounding errors into an account and write it off periodically without even realising why it happens.
Re:Copilot regurgitating Quake code, including sweary comments
by bidirectional on Friday July 02, 2021 @10:18AM
(#27711828)
No, it's just that we're in the realm of predictions and modelling, not accounting. If you're constructing a curve to forecast 50 years of interest rates from a limited set of instruments, you're already accepting a margin of error orders of magnitude greater than the inaccuracies introduced by floating point.
The models also use transcendental functions which cannot be accurately calculated with fixed point, rationals, integers etc.
Re:Copilot regurgitating Quake code, including sweary comments
by jhugo on Friday July 02, 2021 @10:46AM
(#27712185)
Makes sense; I wasn't aware of the meaning of "front office" as a term of art in finance.
Re:Copilot regurgitating Quake code, including sweary comments
by BruiseLee on Friday July 02, 2021 @10:29AM
(#27711970)
It's not like decimal or fixed point does not suffer from rounding errors either. In fact for many calculations, binary floating point gives more accurate answers.
In accounting there are specific rules that require decimal system, so one must be very careful with the floating point if it is used.
Re:Copilot regurgitating Quake code, including sweary comments
by dirkt on Friday July 02, 2021 @10:10AM
(#27711740)
And the all suffer from rounding error problems?
I mean, fixed point and a specific type for currency (which also should include the denomination, while we are at it) are not rocket science. Spreadsheets get that right, at least.
Re:Copilot regurgitating Quake code, including sweary comments
by bidirectional on Friday July 02, 2021 @10:12AM
(#27711764)
Excel uses IEEE-754 floating point, so I don't get what you mean with the spreadsheet comment. It has formatting around this which rounds and adds currency symbols, but it's floating point you're working with.
Rounding error doesn't matter on these types of financial applications. It's the less glamorous accounting work that has to bother with that.
They're not rocket science, but they're unnecessary, and would still be off anyway. Try and calculate compound interest with your fixed point numbers.