6 ms·
The rust_decimal crate seems to use C#-style decimals, which always struck me as wasteful. Is there any particular advantage to that format over IEEE decimal f
by SloopJon 5y ago
The rust_decimal crate seems to use C#-style decimals, which always struck me as wasteful. Is there any particular advantage to that format over IEEE decimal floating point?
- pclmulqdq 5y agoWithout hardware support, IEEE 754 decimal floating point can have some very sharp edges. I'm sure that the C# decimal format avoids these by spending more space. I'm personally surprised that this firm isn't using "integer # of exchange ticks" as their storage format for prices...
- cantortrading 5y agoInteger # of exchange ticks would be nice, but that covers a very wide integer range across a lot of products and changes without warning (not to mention, can be inconsistently applied...). Using base-10 decimals is a good compromise between the perfect solution and something that 'just works'. It also means we don't have to go rewrite everything and instead can just do some optimization work when needed.