Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 |
30 | 31 |
Tags
- 72410
- 데이터타입함수
- client-side-rendering
- 약타입
- 약타입언어
- 함수형프로그래밍
- 나를부르는숲
- Server-Side-Rendering
- 중첩함수
- textinput
- switch구문
- lineending
- DelayInput
- 비반환함수
- reactnative android
- multiline
- ios
- next.js
- 동적언어
- 리액트네이티브
- beforePopState
- reactnavigation
- 17681
- SWIFT
- 옵셔널
- replacingOccurrences
- JavaScript
- ReactNative
- 프로그래머스
- 스위프트
Archives
- Today
- Total
목록진수변환 (1)
으니의 개발로그
[Swift] 진수 변환
[Swift] 진수 변환 10진수 -> 2진수 let decimal: Int = 30 let binary: String = String(decimal, radix: 2) print(binary) /* 11110 */ 2진수 -> 10진수 let binary: String = "11011" let decimal: Int = Int(binary, radix: 2)! print(decimal) /* 27 */ radix 를 2로 지정하면 정말 간단하게 10진수 2진수의 변환이 가능하다. 조금 주의할 점은 10진수는 타입이 Int, 다른 진수의 타입은 String 이라는 것! 타입을 어떻게 넣느냐에 따라 10진수로 바뀌느냐 2진수로 바뀌느냐가 결정된다. 그리고 2진수에서 10진수로 변환할 때 ! 를 넣어주는 이..
Swift/with. APS
2021. 2. 13. 13:37