Difference between revisions of "Long Integer"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>ShadowDancer
m (typo)
imported>QQuix
(Added note with the larget integer)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''Long''' is an integer format that uses 32 bit for data.  
'''Long''' is an integer format that uses 32 bit for data. The highest bit is the sign, so the variable ranges from -2^31 (-2147483648) to 2^31-1 (2147483647).


The highest bit is the sign, so the variable ranges from -2^31 (-2147483648) to 2^31-1 (2147483647)
However, in Oblivion, all longs are actually stored as [[Floating_Point|floats]], so they experience the same limitations as floats, and so cannot actually reach the ranges that a long should be able to reach (see the float article for more information on float's limitations; see the Discussion here for information on how this was discovered).


There are no restrictions when using a long as a local variable within [[Object scripts]], but longs inside [[Quest scripts]], as well as [[Globals|global]] variables, are internally stored as [[Variable_types:_floating_point|floating point]] and there might be a precision issue with very large values.
==Notes==
*The largest integer you can reliably store in a Long var is 16,777,216.
 
==See Also==
[[Short Integer]]<BR>
[[Floating Point]]


[[Category:Variables]]
[[Category:Variables]]

Latest revision as of 14:31, 18 November 2011

Long is an integer format that uses 32 bit for data. The highest bit is the sign, so the variable ranges from -2^31 (-2147483648) to 2^31-1 (2147483647).

However, in Oblivion, all longs are actually stored as floats, so they experience the same limitations as floats, and so cannot actually reach the ranges that a long should be able to reach (see the float article for more information on float's limitations; see the Discussion here for information on how this was discovered).

Notes[edit | edit source]

  • The largest integer you can reliably store in a Long var is 16,777,216.

See Also[edit | edit source]

Short Integer
Floating Point