Java Remainder of Integer Divison?

后端 未结 5 1303
甜味超标
甜味超标 2021-01-18 01:44

I was searching around about this topic but I still don\'t get it, if someone can elaborate I would be very thankful.

My task is to divide two variables as integer d

5条回答
  •  无人共我
    2021-01-18 02:28

    Yes, the % operator will return the remainder of the Integer division.

    To know more about the remainder of the Integer division check out Wikipedia:

    If a and d are integers, with d non-zero, it can be proven that there exist unique integers q and r, such that a = qd + r and 0 ≤ r < |d|. The number q is called the quotient, while r is called the remainder.

提交回复
热议问题