Python 2:
sys 패키지에서 max값을 제공한다.
sys.maxint로 정수 최대값을 구할 수 있다. 이 최대값을 초과할 시 int->long으로 자동전환 된다.
Python 3:
python3에서 int와 long의 구분이 없어져 int은 unbound다. 만약 word size를 구하고 싶다면 sys.maxsize를 사용한다.
PEP 237: Essentially, long renamed to int. That is, there is only one built-in integral type, named int; but it behaves mostly like the old long type.

결론: Python에서 int의 범위는 고려할 필요가 없다.
출처: https://stackoverflow.com/questions/7604966/maximum-and-minimum-values-for-ints
'algorithm > python' 카테고리의 다른 글
| 프로그래머스/스택,큐/프린터 (0) | 2022.06.20 |
|---|---|
| 프로그래머스/스택,큐/주식 가격 (0) | 2022.06.14 |
| codility/lesson5/prefix sums/passingCars (0) | 2022.02.14 |
| 백준/2108/통계학 (0) | 2021.10.27 |
| hackerrank/Data Structures/Arrays/Sparse Arrays (0) | 2021.07.25 |