Swift - 03 - 整数类型

//: Playground - noun: a place where people can play

import UIKit

var str = "Hello, playground"

let MAXVALUEOFUINT8 = UInt8.max
let MINVALUEOFUINT8 = UInt8.min

/* 
    Int的取值范围是根据计算机的位数来决定, 例如你的计算机是64位
    Int就相当于Int64
    Swift不建议使用Int8这种后面加数字的写法,因为一旦你的代码用到
    别的机器, 可能会出现一些问题
    最好就是使用Int, 这样代码出错率就降低了
*/
let MINVALUEOFINT = Int.min
let MAXVALUEOFINT = Int.max

  

posted @ 2015-12-16 10:57  Rinpe  阅读(180)  评论(0编辑  收藏  举报