Difference between revisions of "Floor - Math"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>JLundin
imported>JustinOther
m (Added note: 'fValue As Int' is faster than 'Math.Floor(fValue)')
Line 22: Line 22:
int y = Floor(5.9) ; y == 5
int y = Floor(5.9) ; y == 5
</source>
</source>
== Notes ==
*Casting a Float to an Int verifiably produces the same results and is measurably faster.


== See Also ==
== See Also ==
*[[Math Script]]
*[[Math Script]]
*[[Ceiling - Math]]
*[[Ceiling - Math]]

Revision as of 14:01, 8 October 2012

Member of: Math Script

Calculates the largest integer less than or equal to the passed in value.

Syntax

int Function Floor(float afValue) native global

Parameters

  • afValue: The value to get the floor of.

Return Value

The floor of the passed-in value.

Examples

int x = Floor(2.1) ; x == 2
int y = Floor(5.9) ; y == 5

Notes

  • Casting a Float to an Int verifiably produces the same results and is measurably faster.

See Also