Difference between revisions of "LlRound"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
|func_footnote=If the absolute value of the tenths position is 4 or less, '''val''' is rounded off; otherwise, '''val''' is rounded towards infinity of like signedness of '''val'''. | |func_footnote=If the absolute value of the tenths position is 4 or less, '''val''' is rounded off; otherwise, '''val''' is rounded towards infinity of like signedness of '''val'''. | ||
|p1_type=float|p1_name=val|p1_desc=Any valid float value | |p1_type=float|p1_name=val|p1_desc=Any valid float value | ||
|return_type= | |return_type=integer | ||
|return_text=that is '''val''' rounded towards zero by traditional numeric rounding. | |return_text=that is '''val''' rounded towards zero by traditional numeric rounding. | ||
|spec | |spec | ||
|caveats | |caveats | ||
|constants | |||
|examples= | |examples= | ||
<lsl> | <lsl> | ||
Line 21: | Line 22: | ||
*{{LSLG|llCeil}} | *{{LSLG|llCeil}} | ||
*{{LSLG|llFloor}} | *{{LSLG|llFloor}} | ||
|also_events | |||
|also_articles | |||
|also_tests | |||
|notes | |notes | ||
|permission | |||
|negative_index | |||
|cat1=Math | |||
|cat2 | |||
|cat3 | |||
|cat4 | |||
}} | }} | ||
Revision as of 01:17, 14 February 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: integer llRound( float val );11 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns an integer that is val rounded towards zero by traditional numeric rounding.
• float | val | – | Any valid float value |
If the absolute value of the tenths position is 4 or less, val is rounded off; otherwise, val is rounded towards infinity of like signedness of val.
Caveats
Examples
<lsl> default {
state_entry() { llSay(0,"The rounded value of -4.5 is: "+(string)llRound(-4.5) ); }
}
</lsl>