Bitwise operations for cross Lua compatibility.
This commit is contained in:
15
src/rmath.c
15
src/rmath.c
@@ -30,6 +30,21 @@ int lmathRound( lua_State* L ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> result = RL.Sign( float value )
|
||||
|
||||
Sign of value
|
||||
|
||||
- Success return int
|
||||
*/
|
||||
int lmathSign( lua_State* L ) {
|
||||
float value = luaL_checknumber( L, 1 );
|
||||
|
||||
lua_pushinteger( L, 0 <= value ? 1 : -1 );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> result = RL.Clamp( float value, float min, float max )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user