LoginSignup
0
0

More than 3 years have passed since last update.

UIntegerに0x80000000を代入したい

Posted at

VB.NETのUIngeterに16進数の0x80000000を代入しようとしてエラーに遭遇しました。
UIngeterに16進数の0x80000000を代入

小一時間調べたところ、VB.NETで&H80000000はIntegerのリテラルとして認識されるため、10進数でいうところの-2147483648として評価されているようです。
&H80000000を明示的に、UIntegerのリテラルだと認識させるには末尾にUIを付けます。

Dim hoge As UInteger = &H80_00_00_00UI

ちなみに、C#では特に問題ないようです。

0
0
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
0
0