美文网首页
oc 和 swift int 类型取值

oc 和 swift int 类型取值

作者: 我想静静看着你装B | 来源:发表于2021-01-25 11:52 被阅读0次

oc

int z = 2147483647;   0111 1111 1111 1111 1111 1111 1111 1111
int f = -2147483647;  1000 0000 0000 0000 0000 0000 0000 0001
int z = 2100000000;   0111 1101 0010 1011 0111 0101 0000 0000
int f = -2100000000;  1000 0010 1101 0100 1000 1011 0000 0000
int z = 210000000;    0000 1100 1000 0100 0101 1000 1000 0000
int f = -210000000;   1111 0011 0111 1011 1010 0111 1000 0000

SInt16 sint16z = 32767;  0111 1111 1111 1111
SInt16 sint16f = -32767; 1000 0000 0000 0001

SInt32 sint32z = 2147483647;  0111 1111 1111 1111 1111 1111 1111 1111
SInt32 sint32f = -2147483647; 1000 0000 0000 0000 0000 0000 0000 0001

SInt64 sint64z = 9223372036854775807; 0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111
SInt64 sint64f = -9223372036854775807;1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001

NSInteger integerz = 9223372036854775807; 0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111
NSInteger integerf = -9223372036854775807;1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001

swift

var Intz: Int = 9223372036854775807  0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111
var Intf: Int = -9223372036854775807 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001

var sint16z: sint16 = 32767 0111 1111 1111 1111
var sint16z: sint16 = 32767 1000 0000 0000 0001

var sint32z: sint32 = 2147483647  0111 1111 1111 1111 1111 1111 1111 1111
var sint32f: sint32 = -2147483647 1000 0000 0000 0000 0000 0000 0000 0001

var sint64z: sint64 = 9223372036854775807  0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111
var sint64f: sint64 = -9223372036854775807 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001

相关文章

  • oc 和 swift int 类型取值

    oc swift

  • Swift-07:枚举enum

    这里先介绍一下swift枚举与oc枚举的区别 OC: 枚举只能为Int类型swift : 可以在枚举中定义方法 可...

  • Swift 3.0 学习笔记之简介

    Swift 提供了自己的基本数据类型对应C和OC中的基本数据类型,包括Int描述整型,Double和Float描述...

  • Swift入门_基础部分

    1.变量和常量 Swift中的变量和和常量的声明和JS很像,Swift中,不会再看到像OC中那样的数据类型(int...

  • Swift3.0基础学习一

    Swift与OC区别语句结束不需要写“;”换行即可(建议书写)int,float等类型变成了Int,Float首字...

  • 1.1 Swift认识

    Swift是建立在OC和C的基础之上,有一下类型: Int 整型 Double 和 Float 是浮点型 Bool...

  • swift和OC混编的坑

    在swift 中的类变量声明Int类型时不能是Int?,否则在OC中读不出这个变量.如果声明Int变量同时赋值就可以.

  • Swift 基础笔记 - 枚举

    枚举 OC定义和使用枚举 Swift定义枚举类型 Swift判断枚举类型 枚举成员类型

  • 2019-08-15

    一、OC基本数据类型 计算一下他们的取值范围: 以int 为例:int所在4个字节 1Btye = 8bit。 共...

  • 工作随笔

    一、OC基本数据类型 计算一下他们的取值范围: 以int 为例:int所在4个字节 1Btye = 8bit。 共...

网友评论

      本文标题:oc 和 swift int 类型取值

      本文链接:https://www.haomeiwen.com/subject/cxbbzktx.html