Difference between revisions of "Fixed Precision"
Jump to navigation
Jump to search
m (lsl code tagging) |
m |
||
Line 1: | Line 1: | ||
{{LSL Header}} | {{LSL Header|ml=*}} | ||
== Function to do fixed precision == | == Function to do fixed precision == | ||
Line 14: | Line 14: | ||
{{LSLC|Examples|Fixed Precision}} | {{LSLC|Examples|Fixed Precision}} | ||
Revision as of 16:21, 24 October 2008
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.
<lsl> string fixedPrecision(float input, integer precision) {
if((precision = (precision - 7 - (precision < 1))) & 0x80000000) return llGetSubString((string)input, 0, precision); return (string)input;
} </lsl>