3 ms·
Realtime trading systems. If your system is slow, you lose money. If your trading system says you earned $1,523,374.54, but your accounting system says you onl
by yummyfajitas 14y ago
Realtime trading systems.
If your system is slow, you lose money. If your trading system says you earned $1,523,374.54, but your accounting system says you only earned $1,523,374.26, you don't care much.
- CodeMage 14y agoI'm genuinely curious here: why would using integers be slower than using floats? I thought floating point operations were always more expensive than handling ints.
- yummyfajitas 14y agoFor simple accounting, it wouldn't be slower. The issue is analytical code, e.g.: int price = getPrice(symbol); double signal = exp(...) * ((double)price); if (signal > threshold) { buy(symbol); } The point is to avoid converting from int to double every single time you need to do a calculation.