Fixed Precision: Difference between revisions
Jump to navigation
Jump to search
Huney Jewell (talk | contribs) m LSL Fixed Precision moved to Fixed Precision: LSL prefix deleted |
Huney Jewell (talk | contribs) mNo edit summary |
||
| Line 13: | Line 13: | ||
</pre> | </pre> | ||
{{LSLC|Examples | {{LSLC|Examples|Fixed Precision}} | ||
{{#vardefine:sort|Fixed Precision}} | {{#vardefine:sort|Fixed Precision}} | ||
Revision as of 05:43, 7 September 2007
| LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Function to do fixed precision
Here's a function to do fixed precision.
string fixedPrecision(float input, integer precision)
{
if((precision = (precision - 7 - (precision < 1))) & 0x80000000)
return llGetSubString((string)input, 0, precision);
return (string)input;
}