Skip to content

Commit da327e4

Browse files
committed
add int128,uint128 sample
1 parent 187b5f6 commit da327e4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

107-Integers/integers.gop

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// int type represents a whole number, which can be positive or negative. The
22
// int type size is platform-dependent and will be either 32 or 64 bits. There are
3-
// also integer types that have a specific size, such as int8, int16, int32, and
3+
// also integer types that have a specific size, such as int8, int16, int32, int64, int128, and
44
// int64, but the int type should be used unless you need a specific size.
55
//
66
// uint type represents a positive whole number. The uint type size is platformdependent and will be either 32 or 64 bits. There are also unsigned integer
7-
// types that have a specific size, such as uint8, uint16, uint32, and uint64, but
7+
// types that have a specific size, such as uint8, uint16, uint32, uint64, uint128, but
88
// the uint type should be used unless you need a specific size.
99
//
1010
// For int 20 values can also be expressed in hex (0x14), octal (0o24), and binary notation (0b0010100).
@@ -23,3 +23,6 @@ println 0b0010100 // binary
2323

2424
c := int128(12345) // If you want a different type of integer, you can use casting.
2525
println c
26+
27+
u128 := uint128(12345)
28+
println(u128)

0 commit comments

Comments
 (0)