Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Apple
- Python
- 티스토리챌린지
- esp32
- 퀄컴
- 배당
- 힐스테이트 광교산
- ConnectedHomeIP
- 오블완
- 애플
- homebridge
- 해외주식
- Espressif
- Home Assistant
- 현대통신
- 엔비디아
- MQTT
- 파이썬
- matter
- 홈네트워크
- 매터
- 국내주식
- 월패드
- 코스피
- Bestin
- RS-485
- 나스닥
- 공모주
- 미국주식
- raspberry pi
Archives
- Today
- Total
목록2's Complement (1)
YOGYUI
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/o0JT2/btrc1T2WEjU/k4p61rboshL2FhtOh8kn9k/img.png)
Python 내장함수인 hex는 정수값을 16진수로 표현된 문자열(str)을 반환해준다 help(hex) >> Help on built-in function hex in module builtins: hex(number, /) Return the hexadecimal representation of an integer. hex(12648430) '0xc0ffee' In [1]: hex(25) Out[1]: '0x19' In [2]: hex(1234) Out[2]: '0x4d2' 그런데, 함수의 인자로 음의 정수 (negative integer)를 입력하면 다른 프로그래밍 언어에서와는 다른 결과가 출력된다 In [3]: hex(-1) Out[3]: '-0x1' In [4]: hex(-128) Out[4]:..
Software/Python
2021. 8. 24. 14:31