Skip to content

Commit 529dc61

Browse files
committed
add doc for integers
1 parent 340371b commit 529dc61

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

107-Integers/integers.gop

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1+
// int type represents a whole number, which can be positive or negative. The
2+
// 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
4+
// int64, but the int type should be used unless you need a specific size.
5+
//
6+
// 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
8+
// the uint type should be used unless you need a specific size.
9+
//
10+
// int Literal Values
11+
// Gop values can be expressed literally, where the value is defined directly in the source code file. Common
12+
// uses for literal values include operands in expressions and arguments to functions, as shown following:
113

14+
println 20+20
15+
println 20+30
16+
17+
// int 20, Values can also be expressed in hex (0x14), octal (0o24), and binary notation (0b0010100).
18+
// unit There are no uint literals. All literal whole numbers are treated as int values.

0 commit comments

Comments
 (0)