-- I checked the other similarly titled questions, they are not duplicates.
I was playing around, and noticed that in Excel if I did 5%(-4) (I used function of "=MOD(5,-4)") that the answer was -3. I didn't fully understand this. I checked google (-3), symbolab (1), bing (1), and chatGPT (-1). Of these, chatGPT is the only one that makes sense to me.
The other stackExchange questions had some explanations of mod, but I didn't fully understand them. And also I don't fully understand why there was a difference between sources.
MODtogether with its companion integer division function. According to Excel's support page, Excel definesMOD(n, d) = n - d*INT(n/d), so theMOD(5, -4)result is designed to work with integer division byINT(5/(-4))(whereINTis floor). – peterwhy Jun 12 '24 at 01:26