반응형
숫자 값은 - 로 표현되는 단항 음수 연산자에 의해 부호가 변합니다.
let three = 3
let minusThree = -three // minusThree는 -3
let plusThree = -minusThree // plusThree는 3, 혹은 "minus minus 3"
반응형
'개발 > iOS' 카테고리의 다른 글
Swift 콜렉션 타입 (Collection Types) (0) | 2023.02.16 |
---|---|
Swift 단항 양수 연산자(Unary Plus Operator) (0) | 2023.02.14 |
[Xcode] Provisioning Profiles 삭제 (프로비저닝 프로파일 삭제) (0) | 2023.02.13 |
Swift 사칙 연산자(Arithmetic Operators) (0) | 2023.02.13 |
Swift String 비교 (0) | 2023.02.10 |