Difference between revisions of "Integer"
esse quam videri
(Created page with " =Definition= =Relevance= =Explanation= =Resources= == See also == * C Sharp Data Types * SQL Data Types * .NET Data Types ==Notes== ==External Links==...") |
|||
Line 1: | Line 1: | ||
=Definition= | =Definition= | ||
+ | Integers are a data type that are 32 bits in size. They cannot hold any decimal places, are whole numbers, and can be positive or negative. | ||
=Relevance= | =Relevance= | ||
+ | Integers are commonly used for counting in programming such as for indexes in collections or keeping track of iterations in loops. | ||
=Explanation= | =Explanation= | ||
+ | Integers can be used for arithmetic expressions such as addition, multiplication, division in programming. However, if the result is being saved into an integer, the result should be a whole number. Otherwise, the result will truncate (round to a whole number) which may create undesired results. | ||
+ | <syntaxhighlight lang ="csharp"> | ||
+ | |||
+ | </syntaxhighlight> | ||
Revision as of 19:16, 16 July 2019
Contents
Definition
Integers are a data type that are 32 bits in size. They cannot hold any decimal places, are whole numbers, and can be positive or negative.
Relevance
Integers are commonly used for counting in programming such as for indexes in collections or keeping track of iterations in loops.
Explanation
Integers can be used for arithmetic expressions such as addition, multiplication, division in programming. However, if the result is being saved into an integer, the result should be a whole number. Otherwise, the result will truncate (round to a whole number) which may create undesired results.