Beatmup
utils.hpp File Reference

Go to the source code of this file.

Macros

#define ceili(x, y)   (((x)+(y)-1)/(y))
 integer division x/y with ceiling More...
 
#define roundf_fast(X)   (floorf_fast((X) + 0.5f))
 rounding (nearest integer) More...
 

Functions

int floorf_fast (float x)
 
float modf (float x, float y)
 

Macro Definition Documentation

◆ ceili

#define ceili (   x,
  y 
)    (((x)+(y)-1)/(y))

integer division x/y with ceiling

Definition at line 21 of file utils.hpp.

◆ roundf_fast

#define roundf_fast (   X)    (floorf_fast((X) + 0.5f))

rounding (nearest integer)

Definition at line 22 of file utils.hpp.

Function Documentation

◆ floorf_fast()

int floorf_fast ( float  x)
inline

Definition at line 26 of file utils.hpp.

26  {
27  int i = (int)x;
28  return i - (i > x);
29 }
jobject jlong jint x

◆ modf()

float modf ( float  x,
float  y 
)
inline

Definition at line 32 of file utils.hpp.

32  {
33  return x - y * (int)(x / y);
34 }
jobject jlong jint jint y