プリミティブ型
Last updated
Was this helpful?
Vのプリミティブ型は、Go言語よりも少なくなっています。
bool型(trueまたはfalse)
string型
integer型(int)
float型(float)
rune型(Unicodeコードポイント)-- 0xf09f9880など
array型([])
map型({})
struct型
integer(整数)型はさらにsigned(符号あり)とunsigned(符号なし)に分けられます。signedは正または負の値を表しますが、unsignedは正の値だけを表します。
型名
サイズ
値の範囲
int8
8ビット
-128 〜 27 -1
int16
16ビット
-215 〜 215 - 1
int
32ビット
-231 〜 231 - 1
int64
64ビット
-263 〜 263 - 1
int128
128ビット
-2127 〜 2127 - 1
型名
サイズ
値の範囲
byte
8ビット
0 〜 27 -1
u16
16ビット
0 〜 215 - 1
u32
32ビット
0 〜 231 - 1
u64
64ビット
0 〜 263 - 1
u128
128ビット
0 〜 2127 - 1
Last updated
Was this helpful?
Was this helpful?