From ae1d0b65f16b24f2e0db39cb8baef4af57b2a12f Mon Sep 17 00:00:00 2001 From: jussi Date: Sun, 17 Mar 2024 10:38:30 +0200 Subject: Round and pubsub lib. --- src/rmath.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/rmath.c') diff --git a/src/rmath.c b/src/rmath.c index 2b05c7e..7617d45 100644 --- a/src/rmath.c +++ b/src/rmath.c @@ -15,6 +15,21 @@ inline int imax( int a, int b ) { ## Math - Utils */ +/* +> 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 ) -- cgit v1.2.3