Difference between revisions of "Category:Variables"

330 bytes removed ,  20:52, 9 March 2018
no edit summary
imported>DragoonWraith
(ok, now to figure out how to get it on the bottom...)
imported>Lubronbrons
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div id="esstyle">
{{Update}}
<span class="header" style="Display: Block; Margin: -5px -5px 0px -5px;">{{#ifeq: {{NAMESPACE}} | Category | Category | Article }} Needs to be Updated</span>


This {{#ifeq: {{NAMESPACE}} | Category | category | article }} has been marked by editors as one needing attention. Please see the [[:{{NAMESPACE}} talk:{{PAGENAME}}|Talk page]] for details. If you can update the {{#ifeq: {{NAMESPACE}} | Category | category | article }}, please do so.
</div>
There are a few types of variables. Most store numbers, but the special [[Reference Variables]] stores something in the game world so you can run functions on it later.
There are a few types of variables. Most store numbers, but the special [[Reference Variables]] stores something in the game world so you can run functions on it later.


Line 18: Line 15:
As you can see, a [[Long Integer|long]] might be expected to have up to 10 digits, but a [[Floating Point|float]] will not accurately display more than 7 (it can, however, accurately show a number of less than eight digits followed by twenty or more zeros, if necessary), and so a [[Long Integer|long]] will '''not''' behave as expected because it is actually a [[Floating Point|float]]. See the [[Floating Point|float article]] for more information on floats' accuracy, and see [[Talk:Long Integer|Long's Talk page]] for details on this discovery.
As you can see, a [[Long Integer|long]] might be expected to have up to 10 digits, but a [[Floating Point|float]] will not accurately display more than 7 (it can, however, accurately show a number of less than eight digits followed by twenty or more zeros, if necessary), and so a [[Long Integer|long]] will '''not''' behave as expected because it is actually a [[Floating Point|float]]. See the [[Floating Point|float article]] for more information on floats' accuracy, and see [[Talk:Long Integer|Long's Talk page]] for details on this discovery.


Other than that, however, generally [[Long Integer|longs]] and [[Short Integer|shorts]] will be rounded off to the nearest integer (i.e. 1.25 becomes 1, 1.75 becomes 2), while [[Floating Point|floats]] will store the decimal data. However, if a variable is a Global, then it will ''always'' be a [[Floating Point|float]] and therefore will not round off the decimal values.


NOTE : Long ago, an OBSE developer mentioned that, internally, the engine stores ALL vars as floats. (QQuix) so it is no problem if you set short value above 32767, the maximum limit positive number is 2,147,483,647 (or hexadecimal 7FFF,FFFF16)


Other than that, however, generally [[Long Integer|longs]] and [[Short Integer|shorts]] will be rounded off to the nearest integer (i.e. 1.25 becomes 1, 1.75 becomes 2), while [[Floating Point|floats]] will store the decimal data. However, if a variable is a Global, then it will ''always'' be a [[Floating Point|float]] and therefore will not round off the decimal values.
==See Also==
 
[[Introduction to OBSE arrays]]


<div id="catlinks"><p class='catlinks'>[[Special:Categories|Category]]: [[:Category: Scripting|Scripting]] | [[:Category: Commands]] | [[:Category: Functions]] | [[:Category: Articles to be Updated|Articles to be Updated]]</p></div>
[[Category: Functions|Z]]
[[Category:Scripting]]
[[Category:Commands]]
Anonymous user