Go Integers: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 4: Line 4:


=Overview=
=Overview=
Integers are designated by the following [[Go Concepts - Lexical Structure#Pre-Declared_Identifiers|pre-declared type identifiers]]:


Unsigned integers: <tt>uint8</tt> (or <tt>byte</tt>), <tt>uint16</tt>, <tt>uint32</tt> (or <tt>rune</tt>), <tt>uint64</tt>.
Unsigned integers: <tt>uint8</tt> (or <tt>byte</tt>), <tt>uint16</tt>, <tt>uint32</tt> (or <tt>rune</tt>), <tt>uint64</tt>.

Revision as of 18:11, 22 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.

int should be the default.

Integer Literals