数据类型
//: Playground - noun: a place where people can play
import Cocoa
var str = "Hello, playground"
let cat = "?";print(cat)
let minVale = uint8.min
let maxVlaue = uint8.max
let folatVlaue = 1999.00
let menaingOFlife = 42
let pi = 3.1215926
//被推算为Double 类型
let anotherPi = 3 + 0.144455
let decimalIngeger = 17
let binaryIngeger = 0b1001
let octtalIngetger = 0o21
let hexadeciamailIngegr = 0x11
// 浮点字面量可以是十进制(没有前缀)或者是十六进制(前缀是 0x )。小数点两边必须有至少一个十进制数 字(或者是十六进制的数字)。浮点字面量还有一个可选的指数(exponent,在十进制浮点数中通过大写或者小 写的 e 来指定,在十六进制浮点数中通过大写或者小写的 p 来指定。
// 如果一个十进制数的指数为 exp ,那这个数相当于基数和10^exp的乘积: * 1.25e2 表示 1.25 × 10^2,等于 125.0 。 * 1.25e-2 表示 1.25 × 10^-2,等于 0.0125 。
// 如果一个十六进制数的指数为 exp ,那这个数相当于基数和2^exp的乘积: * 0xFp2 表示 15 × 2^2,等于 6 0.0 。 * 0xFp-2 表示 15 × 2^-2,等于 3.75
let decimalDouble = 12.1875
let exponentDouble = 1.21875e1
let hexadecimalDouble = 0xC.3p0
let padddDouble = 000123.456
let oneMillion = 1_000_000
let justOverONeMillion = 1_000_000.000_000_1
let connotBeNative :uint8 = 1
let tooBig :Int8 = Int8.max
let twoThousancd:uint16 = 2_000
let one:uint8 = 1
let twoThousandAndONe = twoThousancd + uint16(one)
let three = 3
let pointOneFourFiveNie = 0.14159
let pi1 = Double(three) + pointOneFourFiveNie
let intererPI = Int(pi1)