mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
helper for get sign of integer
This commit is contained in:
@@ -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