From Second Life Wiki
Second Life Wiki >
LSL Portal > LSL Float (Redirected from
Float)
Template:Needs Translation/LSL/es
Template:Needs Translation/LSL/el
Template:Needs Translation/LSL/fr
Template:Needs Translation/LSL/he
Template:Needs Translation/LSL/it
Template:Needs Translation/LSL/ja
Template:Needs Translation/LSL/nl
Template:Needs Translation/LSL/hu
Template:Needs Translation/LSL/no
Template:Needs Translation/LSL/da
Template:Needs Translation/LSL/sv
Template:Needs Translation/LSL/tr
Template:Needs Translation/LSL/pl
Template:Needs Translation/LSL/pt
Template:Needs Translation/LSL/ru
Template:Needs Translation/LSL/uk
Template:Needs Translation/LSL/zh-Hans
Template:Needs Translation/LSL/zh-Hant
/LSL
Floating point data types are 32 bit numbers in IEEE-754 form.
If you want a decimal point in your number, then it is a float.
The Range is 1.175494351E-38 to 3.402823466E+38
They can be specified in scientific notation like 2.6E-5.
If a function requires a float as a parameter, and the number is an integer (e.g. 5), be sure to add a .0 so it is created as a float (e.g. 5.0)
If you are dividing 2 constants, be sure to define them as floats or your result may get rounded. Better yet, do the math on your calculator and save the server some cycles.
Examples
float min = 1.175494351E-38;
float max = 3.402823466E+38;
float sci = 2.6E-5;
float sci_a = 2.6E+3;
float sci_b = 2.6E3;
float sci_c = 26000.E-1;
float f = 2600;//implicitly typecast to a float
float E = 85.34859;
Pages in category "LSL Float"
The following 6 pages are in this category, out of 6 total.
D
P
R
S
T