Basically, I need (-3) % 5 to be \"2\" instead of \"-3\". Python produces \"2\", but C++ produces \"-3\". Not sure how to produce \"2\" in C++. Thanks!
(-3) % 5
Add the base if the input number X is negative:
X
X % Y + (X % Y < 0 ? Y : 0);