Difference between revisions of "Float"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:
[[Category:LSL Types]]
[[Category:LSL Types]]
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, be sure to specify a .0 so it is created as a float (e.g. 1.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.

Revision as of 15:43, 14 February 2007

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, be sure to specify a .0 so it is created as a float (e.g. 1.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.