Difference between revisions of "Integer"
Jump to navigation
Jump to search
Jeff Kelley (talk | contribs) |
m (<lsl> examples) |
||
Line 10: | Line 10: | ||
==Examples== | ==Examples== | ||
All of the following are integers: | All of the following are integers: | ||
< | <lsl>integer firstInt = 5512623; | ||
integer firstInt = 5512623; | |||
integer secondInt = ACTIVE; | integer secondInt = ACTIVE; | ||
integer | integer thirdInt = 0x61EC1A; | ||
integer fourthInt = -160693; | integer fourthInt = -160693;</lsl> | ||
</ | |||
The following are NOT integers, see {{LSLG|float}} for them: | The following are NOT integers, see {{LSLG|float}} for them: | ||
< | <lsl>integer firstInt = 125.2; //Integers can't have a decimal. | ||
integer firstInt = 125.2; //Integers can't have a decimal. | integer secondInt = 10000000000; //Integers can't be larger than 2,147,483,647.</lsl> | ||
integer secondInt = 10000000000; //Integers can't be larger than 2,147,483,647. | |||
</ |
Revision as of 18:58, 31 December 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Integers
An integer data types are signed 32 bit values between −2,147,483,648 and +2,147,483,647 (that is 0x00000000 to 0xFFFFFFFF in hex). Integers are whole numbers. If you want a decimal point, see float.
You can use DEBUG_CHANNEL as a constant for the maximum integer.
Examples
All of the following are integers: <lsl>integer firstInt = 5512623; integer secondInt = ACTIVE; integer thirdInt = 0x61EC1A; integer fourthInt = -160693;</lsl>
The following are NOT integers, see float for them: <lsl>integer firstInt = 125.2; //Integers can't have a decimal. integer secondInt = 10000000000; //Integers can't be larger than 2,147,483,647.</lsl>