아래는 Java의 데이터 타입에 따른 크기 범위이다.
Java에선 100자리수 정수를 정수형 변수로 입력받을 수 없다. (fixed-precision)
하지만 파이썬은 임의 정밀도 방식(arbitrary-precision)을 사용하기 때문에 변수의 크기에 제한이 없다.
https://mortada.net/can-integer-operations-overflow-in-python.html
Can Integer Operations Overflow in Python? — Random Points
We can see that it takes 28 bytes before we get to $2^{30}$ where python allocates 4 more bytes to store larger integers. Certainly not the most compact representation, as a raw 64-bit array (i.e. 8 bytes) could do the job with fixed-precision. However we
mortada.net
-미완-
'파이썬 > 기본' 카테고리의 다른 글
[파이썬] glob (0) | 2023.10.09 |
---|---|
[파이썬] OS모듈 (0) | 2023.09.15 |
[파이썬] 객체지향과 클래스 (0) | 2023.09.14 |
[파이썬] 재귀 호출 (0) | 2023.09.14 |
[파이썬] 콜백함수 & 람다함수 (0) | 2023.09.14 |
댓글