zoukankan      html  css  js  c++  java
  • C# Int32类型取高、低16位

    int num = 132073;

    int low = num & 0xffff;

    int high = num >> 16;

    PS:整型的三类

    1.   Int16  / 16位整数   

          取值范围:   [ -2^15  (低8位)   , 2^15-1  (高8位)  ]

    2.   Int32  / 32位整数   (默认int类型)

          取值范围:   [ -2^31 (低16位)  ,  2^31-1 (高16位) ] 

    2.   Int64  / 64位整数  

          取值范围:   [ -2^63 (低32位)  ,  2^64-1 (高32位) ]

      

  • 相关阅读:
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    C#中的委托是什么
    C# Lambda表达式Contains方法 like
  • 原文地址:https://www.cnblogs.com/HansZimmer/p/10309057.html
Copyright © 2011-2022 走看看