is a signed
value with valid range from -2147483648 to 2147483647 (that is 0x80000000 to 0x7FFFFFFF in hex). LSL
does not have an unsigned integer type
An integer is a whole number (no decimals). If you want decimals, you want a float
As of Second Life 1.5
, integers can be entered in hexadecimal
etc...) Strings typecast
to integers also take these formats into account.
integer dec = 42; // 42 decimal
integer hex = 0xff; // 255 decimal
Octal support was added in 1.5.0 and removed in 1.5.2 because it caused incompatabilities with some existing scripts
. The Lindens have not mentioned any plans to bring it back.
To round a float to an integer, use llRound
Beware, a integer variable assigned a value larger/smaller than the valid range is instead assigned a value of -1.
// Watch out! This will compile, but will result in x having the value of -1.
integer x = 12345678900000;
| Memory Usages