mirror of
https://github.com/recp/cglm.git
synced 2026-11-20 10:43:09 -06:00
helper for get sign of integer
This commit is contained in:
1 parent
a410b880b4
commit
4ac8eaa1c9
1 file changed
+11
@@ -10,6 +10,17 @@
|
|||||||
|
|
||||||
#include "cglm-common.h"
|
#include "cglm-common.h"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief get sign of 32 bit integer as +1 or -1
|
||||||
|
*
|
||||||
|
* @param X integer value
|
||||||
|
*/
|
||||||
|
CGLM_INLINE
|
||||||
|
int
|
||||||
|
glm_sign(int val) {
|
||||||
|
return ((val >> 31) - (-val >> 31));
|
||||||
|
}
|
||||||
|
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
float
|
float
|
||||||
glm_rad(float deg) {
|
glm_rad(float deg) {
|
||||||
|
|||||||
Reference in new issue
Block a user