LoginSignup
1
1

More than 5 years have passed since last update.

配列の添字がでかいとき

Posted at

2^32 - 1

$ perl -e 'print [0,1,2,3]->[4294967295]'
3

2^32

$ perl -e 'print [0,1,2,3]->[4294967296]'
0

64ビット環境なんだけど32ビット符号付き整数として処理されてる模様。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1