e******r 发帖数: 220 | 1 int64 VS int32. 什么语言什么环境下要格外注意呢?
谢谢 | h*******e 发帖数: 225 | 2 Your question is not well defined.
【在 e******r 的大作中提到】 : int64 VS int32. 什么语言什么环境下要格外注意呢? : 谢谢
| l*****d 发帖数: 359 | 3 first, you should know a 64-bit int has much larger range available than than 32-
bit int, right?
This kind of usage for portability. for example in a machine when 'int' is
4bytes and 'long' is 8bytes:
typedef int Int32
typedef long Int64
use Int32 and Int64 in your program.
When porting your program to a difference machine when 'int' is 8bytes, but
'short' is 4 bytes, you can just change the type define:
typedef short Int32
typedef int Int64
and you don't need to change anything in your program
【在 e******r 的大作中提到】 : int64 VS int32. 什么语言什么环境下要格外注意呢? : 谢谢
| c*****t 发帖数: 1879 | 4 There are a lot more issues. Things such as alignment, casting,
overflow, bit operation, dealing with I/O etc.
than 32-
but
【在 l*****d 的大作中提到】 : first, you should know a 64-bit int has much larger range available than than 32- : bit int, right? : This kind of usage for portability. for example in a machine when 'int' is : 4bytes and 'long' is 8bytes: : typedef int Int32 : typedef long Int64 : use Int32 and Int64 in your program. : When porting your program to a difference machine when 'int' is 8bytes, but : 'short' is 4 bytes, you can just change the type define: : typedef short Int32
|
|