基本整数类型是int类型,按符号可以分为有符号的(signed)和无符号的(unsigned)两类;按照数据范围大小,又可以分成短整数(short)和长整数(10ng),用于存放字符数据的char类型实质上也是整数类型。
基于192个网页-相关网页
这两个除法都会避免调用除法函数,另外,无符号的除法要比有符号的除法使用更少的指令。
Both divisions will avoid calling the division function and the unsigned division will take fewer instructions than the signed division.
产生的完美 hash() 函数返回一个无符号的 int 值,范围为 0..(k-1),其中 k 值为最大关键字散列值加 1。
The resulting perfect hash() function returns an unsigned int value in the range 0..(k-1), where k is the maximum keyword hash value +1.
将字符指针和字符字节声明为无符号类型的,这样可以防止8位字符的符号扩展问题。
Declare character Pointers and character bytes as unsigned to avoid sign extension problems with 8-bit characters.
应用推荐