Difference between revisions of "LlRound"

From Second Life Wiki
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=float
|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
}}
}}
[[Category:LSL_Functions]]
[[Category:LSL_Math]]

Revision as of 01:17, 14 February 2007

Summary

Function: integer llRound( float val );

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.

Examples

<lsl> default {

  state_entry()
  {
      llSay(0,"The rounded value of -4.5 is: "+(string)llRound(-4.5) );
  }

}

</lsl>

See Also

Functions

Deep Notes

Search JIRA for related Issues

Signature

function integer llRound( float val );