Last active
August 29, 2015 14:05
-
-
Save arslanbilal/595e688f7f9ec9815c34 to your computer and use it in GitHub Desktop.
Swift Numeric Literals
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 decimalInteger = 17 | |
let binaryInteger = 0b10001 // 17 in binary notation | |
let octalInteger = 0o21 // 17 in octal notation | |
let hexadecimalInteger = 0x11 // 17 in hexadecimal notation | |
let decimalNumber = 1.25e2 // 125.0 e2 means 10^2 | |
let decimalNumber2 = 1.25e-2 // 0.0125 e-2 means 10^-2 | |
let hexadecimalExponent = 0xFp2 // 60.0 means 15x2^2 | |
let hexadecimalExponent2 = 0xFp-2 // 3.75 means 15x2^-2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment