2 ms·
The databases use NUMERIC/DECIMAL data types almost exclusively. Once in a while you will find a floating point type but it's pretty rare. The code they write
by RaftPeople 2y ago
The databases use NUMERIC/DECIMAL data types almost exclusively. Once in a while you will find a floating point type but it's pretty rare.
The code they write is not generally available to the public so I'm not sure what they are doing inside their code. Some probably use java's BigDecimal, some probably wrote their own libraries to handle data types (e.g. SAP).
> If ALL you do is addition, then fixed point could work. But it fails at every other basic accounting task that it would be ludicrous to do any modern or even toy programs in it any more.
How about the basic task of storing 0.1 or 0.01, it seems pretty good at that and float (binary float) struggles.
Decimal float works, which is why IBM but the DFP units on the Power and Z cpu's.