Go Integers: Difference between revisions
Jump to navigation
Jump to search
Line 11: | Line 11: | ||
* Machine-dependent integers: <tt>uint</tt>, <tt>int</tt> and <tt>uintptr</tt>. | * Machine-dependent integers: <tt>uint</tt>, <tt>int</tt> and <tt>uintptr</tt>. | ||
<tt>int</tt> should be the default. | When a regular integer is needed in the program, <tt>int</tt> should be the default. | ||
=<tt>byte</tt>= | =<tt>byte</tt>= |
Revision as of 01:34, 23 March 2016
Internal
Overview
Integers are designated by the following pre-declared type identifiers:
- Unsigned integers: uint8 (or byte), uint16, uint32 (or rune), uint64.
- Signed integers: int8, int16, int32, int64.
- Machine-dependent integers: uint, int and uintptr.
When a regular integer is needed in the program, int should be the default.
byte
byte is unsigned int represented on a byte (uint8).
Indexing operator [] applied to strings return bytes.
Conversion of a byte to string
TODO