I think power (^) has higher precedence than subtract (-).
So (2^32-1)/10000 == ((2^32)-1)/10000
WolframAlpha agrees: https://www.wolframalpha.com/input/?i=%282%5E32-1%29%2F10000...
I have seen differences in the precedence of logical operators between languages (and > or but what happens when you have both math and logic in the same statement isn't entirely consistent) and always use parenthesis in those cases--although these days if Resharper says it's redundant I let it remove them.
I always assume the floor for equity is the first tick above zero, e.g., 1 US cent or 1 Euro cent or 1 Japanese yen. Honestly, I don't know if any traditional stock exchanges allow zero price or less for shares. If anyone knows an example, please post about it!
Another reason why this comment matters: Does anyone remember when oil futures went negative? (April 2020) I am sure more than a few computer systems were unprepared for that scenario. I remember when short-end Japanese rates were zero and negative after the 2008 Global Financial Crisis. It was a real monkey wrench in the machine!
The the intention of both comments was clear... To discuss signed vs unsigned integer.
Both are a bit slower than using ints built into the machine, but exchanges don't have to be particularly fast. (In contrast to HFT participants. But they just need to be faster than their competitors.)
When you say rational numbers, do you literally mean a fraction, or are you talking about a floating point representation? I'm not sure what a fraction would do over fixed point in this usage, and floating point is best avoided for anything finance related due to the fact that they're approximate.
They probably regret not just using 64-bit from the start, but on the other hand somebody likely saved a measurable amount of money on storage over the years. Potentially not worth the cost to figure out a workaround now, though.
Perhaps they could implement a rule where if the field equals MAX_UINT32, then the value must be looked up in an auxiliary database table. Depending on how much crufty code there is assuming 32-bit though, it may be their equivalent of y2k.
Yes, variable length fields are a bit annoying. But my argument is that the exchange itself doesn't need to be that fast. And the market makers just need to be faster than each other.
(For anyone else, exchanges just need to be fast enough.)
Yes, just using a 64 bit integers is probably the easiest here.
Floats would be worse than my suggestion to use variable length rational numbers, for exactly the reasons you know.