Difference between revisions of "Category:LSL Integer"

From Second Life Wiki
Jump to navigation Jump to search
m
(→‎Examples: Distinguish compile-time examples of LSL_Errors from run-time examples of astonishing results; Substitute 123456789 for 0000000000 or for 000000000 to make the digits more countable)
Line 15: Line 15:


The following are NOT integers, use {{LSLG|float}} for them:
The following are NOT integers, use {{LSLG|float}} for them:
<lsl>integer firstInt = 125.2; //Integers can't have a decimal.
<lsl>
integer secondInt = 10000000000; //Integers can't be larger than 2,147,483,647.</lsl>
integer decimalValue = 125.2; // ERROR : Type mismatch -- Integer literals can't have a decimal.
integer bigValue = 3147483647; // An undocumented way to say -1,147,483,649 // Integer literals can't be larger than 2,147,483,647.
integer biggerValue = 10123456789; // An undocumented way to say -1 // Integer literals can't be larger than 2,147,483,647.
</lsl>

Revision as of 19:49, 31 December 2008

Integers

An integer data types are signed 32 bit values between −2,147,483,648 and +2,147,483,647 (that is 0x80000000 to 0x7FFFFFFF in hex). Integers are whole numbers. The fractional datatype is the float.

DEBUG_CHANNEL can be used as a constant for the maximum integer (for that is the value it is defined as).

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, use float for them: <lsl> integer decimalValue = 125.2; // ERROR : Type mismatch -- Integer literals can't have a decimal. integer bigValue = 3147483647; // An undocumented way to say -1,147,483,649 // Integer literals can't be larger than 2,147,483,647. integer biggerValue = 10123456789; // An undocumented way to say -1 // Integer literals can't be larger than 2,147,483,647. </lsl>

Pages in category "LSL Integer"

The following 200 pages are in this category, out of 658 total.

(previous page) (next page)
(previous page) (next page)