Chapter 7 : Data-types Integers



Integers



Integers are whole numbers which can be signed, unsigned but not fractions.

What is a Integers


Examples : -10, 30, 0

Swift supports both signed and unsigned integers.The forms supported are 8-bits,16-bits,32-bits and 64-bits.

Example :



Signed Integers

Lets find the range for Signed Integer types,



Integer type Int which on 32-bit platforms has a size that of Int32 and Int64 on a 64-bit platform. It is recommended to use Int in your program.

UnSigned Integers (UInt)

If you are sure that the Integer cannot have a negative value you may use a Unsigned Integer,