나눗셈 정리(Division Theorem)
- 임의의 양의 정수 \( a \),\( d \)에 대하여
- \( 0 \leq r < d \)이고, \( a=dq+r \)을 만족시키는 정수 \( q \)와 \( r \)이 유일하게 존재한다.
- \( r \)이 나머지, 즉 \( r \)은 0보다 크다.(양의 정수이다.)
div와 mod
나눗셈 정리에서
- \( d \)는 제수(divisor), \( a \)는 피제수(dividend), \( q \)는 몫(quotient), \( r \)은 나머지(remainder)라 할 때,
- \( q = a \, div \, d \)
- \( r = a \, mod \, d \) 이다.
- \( 7= 2 \times 3 + 1\ \) 일 때
- \( 2 = 7 \, div \, 3 \)
- \(7 \, mod \, 2 = 1\)
- 음수의 경우 \( -7= 2 \times (-4) + 1\ \) 이므로
- \(-7 \, mod \, 2 = 1\)
반응형
'Mathematics' 카테고리의 다른 글
[Mathematics] 제수, 피제수, 몫, 나머지 (0) | 2022.07.28 |
---|---|
[Mathematics] 소인수분해(Prime Factorization) (0) | 2022.06.16 |
[Mathematics] 등차수열(Arithmetical Sequence) (0) | 2022.06.06 |
[Mathematics] 바빌로니아 법(The Babylonian Method) 제곱근 구하기 (0) | 2022.05.30 |
[Mathematics] 조합 (Combination) (0) | 2022.05.27 |
댓글