Created
January 18, 2016 15:44
-
-
Save ericdke/a15e6504eefabc8c7859 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let binNum = 42 | |
let binStr = String(binNum, radix: 2) | |
print(binStr) | |
let octNum = 42 | |
let octStr = String(octNum, radix: 8) | |
print(octStr) | |
let hexNum = 42 | |
let hexStr = String(hexNum, radix: 16) | |
print(hexStr) | |
let b = Int(0b101010) | |
print(b) | |
let o = Int(0o52) | |
print(o) | |
let h = Int(0x2a) | |
print(h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment