수,number를 기록하는 방법.
유한개의
기호,symbol(
문자,character나
숫자,digit)를 써서 수를 표현하는 방법.
단순 기수법(simple grouping system), 승법적 기수법(multiplicative grouping system), 기호 기수법(ciphered numeral system), 위치 기수법(positional numeral system) 등.
Positional numeral systems ¶
'진법'과 일대일 대응하는 영단어는 없는 듯.
진법에 따르면 "n진법은 ... 위치적 기수법이라고도 한다"는데 chk
정수, 소수점, ... 진법 변환은 뻔하므로 생략
가장 중요한 둘은
base 2 = binary (컴퓨터가 사용)
base 10 = decimal (사람이 사용)
그 다음으로는 base 16, base 8이 언급.
가중값,weight이 n진법의 경우 1, n, n², n³, … 즉 n
0, n
1, n
2, n
3, …이 되는,
숫자,digit의 위치에 따른
가중합,weighted_sum으로 볼 수 있다.
Positional notation with a radix of
n
n진법 | 시스템의 이름 | 동의어 |
2진법 | base-2 numeral system | binary numeral system |
3진법 | | ternary n. s. |
4진법 | | quaternary n. s. |
8진법 | base-8 n. s. | octal n. s. |
9진법 | | nonary nonary |
10진법 | base-10 | decimal, denary denary |
16진법 | base-16 | hexadecimal |
64진법 | Base64 | |
특히 2진법은
논리회로,logic_circuit, esp.
논리게이트,logic_gate,
불_대수,Boolean_algebra and
불_논리,Boolean_logic,
Category:Binary_arithmetic,
디지털시스템,digital_system과 관련, TOCLEANUP
이진수,binary_number의
숫자,digit은
비트,bit라고 부름
각 진법에 해당하는 수는
| 숫자,digit | 리터럴,literal 표기법들 |
이진수,binary_number | 0, 1 - rel. 비트,bit | 0bxx |
.. | | ... |
십육진수,hexadecimal_number ... | 0, 1, 2, ..., 9, A, B, C, D, E, F | 0xXX 또는 XXh |
이런거 뻔한데 쓸까말까?
int(x)는 문자열을 정수로, 실수를 정수로 바꿔주는 한편,
>>> int('3')
3
>>> int(3.7)
3
int(x, radix)는 radix진수로 된 문자열 x를 정수값으로 리턴함.
>>> int('11', 2)
3
>>> int('1A', 16)
26