crypto-chassis / ccapi

A header-only C++ library for interacting with crypto exchanges. Bindings for Python, Java, C#, Go, and Javascript are provided.
https://discord.gg/b5EKcp9s8T
MIT License
555 stars 192 forks source link

confusion about postProcessMessageMarketDataEventTrade in event_handler_base.h? #438

Closed qcmc17 closed 9 months ago

qcmc17 commented 9 months ago

Describe the bug I can not understand why divde then multiple same value in postProcessMessageMarketDataEventTrade? int intervalStart = UtilTime::getUnixTimestamp(messageTime) / this->adverseSelectionGuardMarketDataSampleIntervalSeconds * this->adverseSelectionGuardMarketDataSampleIntervalSeconds;

cryptochassis commented 9 months ago

It is integer division: https://stackoverflow.com/questions/3602827/what-is-the-behavior-of-integer-division.