Please explain why 17 @ = 17

前端 未结 6 2054
[愿得一人]
[愿得一人] 2021-01-28 06:22

I am new to Java, actually programming in general. I understand that the modulus operator (%) returns the remainder of two numbers, however, I do not understand why 17 % 40 = 1

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-28 06:33

    i guess learning back the 3rd and 4th standard maths is the key point.

    if u see (hope understand the division syntax. its the popular 3rd std way )

      ____
    40)17
    

    you will get a reminder 17 as 17 is not divisible by 40. then there will be an adition of '.' and then the fraction will be added

提交回复
热议问题