News for hackers. Stuff that matters.
Re:C++ proposal: There are 8 bits in a byte by seoulbigchris on Friday October 18, 2024 @04:27AM (#41877394)
Which one? Remember the decimal IEEE 754 floating point formats exist too. Do folks in banking use IEEE decimal formats? I remember we used to have different math libs to link against depending, but this was like 40 years ago.
Re:C++ proposal: There are 8 bits in a byte by mu53 on Friday October 18, 2024 @07:55AM (#41878545)
Java is big for banks, and `BigInteger` is common for monetary types.
Re:C++ proposal: There are 8 bits in a byte by quietbritishjim on Friday October 18, 2024 @06:59AM (#41878213)
Nothing prevents banks (or anyone else) from using a compiler where "float" means binary floating point while some other native or user-defined type supports decimal floating point. In fact, that's probably for the best, since they'll probably have exacting requirements for that type so it makes sense for the application developer to write that type themselves.
Re:C++ proposal: There are 8 bits in a byte by seoulbigchris on Friday October 18, 2024 @11:42AM (#41880459)
I was referring to banks using decimal libraries because they work in base 10 numbers, and I recall a big announcement many years ago when the stock market officially switched from fractional stock pricing to cents "for the benefit of computers and rounding", or some such excuse. It always struck me as strange, since binary fixed and floating point represent those particular quantities exactly, without rounding error. Now with normal dollars and cents calculations, I can see why a decimal library might be preferred.
Re:C++ proposal: There are 8 bits in a byte by stephencanon on Friday October 18, 2024 @09:42AM (#41879403)
Binding float to the IEEE 754 binary32 format would not preclude use of decimal formats; they have their own bindings (e.g. _Decimal64 in C23). (I think they're still a TR for C++, but I haven't been keeping track).