Integer: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>JulienDethurens No edit summary |
>NecroBumpist Reorganize. Add links. Syntax highlighting. |
||
Line 3: | Line 3: | ||
{{CatUp|Data Types}} | {{CatUp|Data Types}} | ||
An integer is classified as any number that has no | An integer is classified as any {{type|number}} that has no fractional component. | ||
{{Example|These are all Integers | |||
5, | {{Example| | ||
45213, | These are all Integers: | ||
753, | {{lua|= <!--fancy number highlighting!--> | ||
-4256, | 5, 45213, 753, -4256, -842, | ||
- | }} | ||
These are '''NOT''' Integers: | |||
{{lua|=<!--fancy number highlighting!--> | |||
5.3, 636.24 | |||
}} | }} | ||
}} | }} | ||
Integers are used when you need a number with no decimal place or it doesn't make sense to have a decimal. Because integers are whole numbers, there are no integers | == Explanation == | ||
Integers are used when you need a {{type|number}} with no decimal place or it doesn't make sense to have a decimal. Because integers are whole {{type|number|numbers}}, there are no integers ''between'' 1 and 2. | |||
In [[RBX.lua.IntValue (Object)|IntValues]], the lowest value it can hold is -2<sup>31</sup> or -2,147,483,648. The highest value it can hold is 2<sup>31</sup>-1, or 2,147,483,647. For the computer geeks out there, this is a 32-bit (or long) signed integer value. | In [[RBX.lua.IntValue (Object)|IntValues]], the lowest value it can hold is -2<sup>31</sup> or -2,147,483,648. The highest value it can hold is 2<sup>31</sup>-1, or 2,147,483,647. For the computer geeks out there, this is a 32-bit (or long) signed integer value. | ||
In Lua scripts, there are no specific integer numbers. The number | In [[Lua]] [[scripts]], there are no specific integer {{type|number|numbers}}. The {{type|number}} values are actually double precision floating point (or just 'double') {{type|numbers}}. | ||
== See Also == | |||
* [[Number|Numbers]] | |||
[[Category:Data types]] | [[Category:Data types]] |
Revision as of 21:17, 15 April 2012
< Scripting | Data Types
An integer is classified as any number that has no fractional component.
Example
These are all Integers:
5, 45213, 753, -4256, -842,
These are NOT Integers:
5.3, 636.24
Explanation
Integers are used when you need a number with no decimal place or it doesn't make sense to have a decimal. Because integers are whole numbers, there are no integers between 1 and 2.
In IntValues, the lowest value it can hold is -231 or -2,147,483,648. The highest value it can hold is 231-1, or 2,147,483,647. For the computer geeks out there, this is a 32-bit (or long) signed integer value.
In Lua scripts, there are no specific integer numbers. The number values are actually double precision floating point (or just 'double') numbers.