Difference between revisions of "Category:Variables"
Jump to navigation
Jump to search
Undo revision 46918 by JOG (Talk)
imported>JOG (Correction: Globals always are floats. Local shorts or longs are longs, never floats.) |
imported>DragoonWraith |
||
Line 1: | Line 1: | ||
{{Update}} | {{Update}} | ||
There are a few types of variables. Most store numbers, but the special [[Reference Variables]] stores | 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. | ||
Although you can [[Declaring_variables|declare a variable]] to be [[Short Integer|Short | Although you can [[Declaring_variables|declare a variable]] to be [[Short Integer|Short]], [[Long Integer|Long]], or [[Floating Point|Float]], all three will be stored like a [[Floating Point|float]]. | ||
This is significant, as [[Floating Point|floats]] have accuracy issues at very high or very low values. When dealing with [[Short Integer|shorts]], this is irrelevant as their range is within the float's "accurate" range. On the other hand, [[Long Integer|longs]] may be expected to be accurate outside of the [[Floating Point|float]]'s range, and they will not be. | This is significant, as [[Floating Point|floats]] have accuracy issues at very high or very low values. When dealing with [[Short Integer|shorts]], this is irrelevant as their range is within the float's "accurate" range. On the other hand, [[Long Integer|longs]] may be expected to be accurate outside of the [[Floating Point|float]]'s range, and they will not be. | ||
To illustrate, the sizes of numbers that should be storable in each type: | To illustrate, the sizes of numbers that should be storable in each type: |