Hey All,
What do you think of representing prices out past the penny? I'm setting up the data structures for the Ritchie Stock Exchange, and started wondering why we only represent prices down to the penny. If memory serves, this is a sensitive issue.. I recall a story of how profit to be made between the pennies (or eighths, if you go back to the 1900's).
In C++, a common type of a decimal number is called a double. This can easily represent a price out to 10 or more decimal places. I personally would not blink an eye if I saw an equity priced at:
$32.18905671631346/share
The Intel Decimal Floating-Point Math Library is targeted at financial applications, and eliminates rounding error (which can drive you cray-zeeee!)
https://software.intel.com/en-us/articles/intel-decimal-floating-point-math-library
I'm thinking, why not use this library to represent prices as a 128-bit signed double? This would obviously provide much more precise pricing. Hmm... I wonder what the performance trade-off is for larger decimals.
Any special reason why pricing is only down to the penny (two decimal places)? There's even lots of room for improvement in Forex, at only five decimal places.
What do you think of representing prices out past the penny? I'm setting up the data structures for the Ritchie Stock Exchange, and started wondering why we only represent prices down to the penny. If memory serves, this is a sensitive issue.. I recall a story of how profit to be made between the pennies (or eighths, if you go back to the 1900's).
In C++, a common type of a decimal number is called a double. This can easily represent a price out to 10 or more decimal places. I personally would not blink an eye if I saw an equity priced at:
$32.18905671631346/share
The Intel Decimal Floating-Point Math Library is targeted at financial applications, and eliminates rounding error (which can drive you cray-zeeee!)
https://software.intel.com/en-us/articles/intel-decimal-floating-point-math-library
I'm thinking, why not use this library to represent prices as a 128-bit signed double? This would obviously provide much more precise pricing. Hmm... I wonder what the performance trade-off is for larger decimals.
Any special reason why pricing is only down to the penny (two decimal places)? There's even lots of room for improvement in Forex, at only five decimal places.
Last edited:
