summaryrefslogtreecommitdiff
path: root/src/rmath.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rmath.c')
-rw-r--r--src/rmath.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rmath.c b/src/rmath.c
index 2b05c7e..7617d45 100644
--- a/src/rmath.c
+++ b/src/rmath.c
@@ -16,6 +16,21 @@ inline int imax( int a, int b ) {
*/
/*
+> result = RL.Round( float value )
+
+Round float value
+
+- Success return float
+*/
+int lmathRound( lua_State* L ) {
+ float value = luaL_checknumber( L, 1 );
+
+ lua_pushnumber( L, round( value ) );
+
+ return 1;
+}
+
+/*
> result = RL.Clamp( float value, float min, float max )
Clamp float value