This commit is contained in:
Learath 2020-09-22 15:47:21 +03:00
parent 586043fc64
commit bbdcb7035d
3 changed files with 24 additions and 18 deletions

View file

@ -45,8 +45,14 @@ constexpr inline int f2fx(float v) { return (int)(v*(float)(1<<10)); }
constexpr inline float fx2f(int v) { return v*(1.0f/(1<<10)); }
// int to fixed
inline int i2fx(int v) { return v<<10; }
inline int fx2i(int v) { return v>>10; }
inline int i2fx(int v)
{
return v << 10;
}
inline int fx2i(int v)
{
return v >> 10;
}
inline int gcd(int a, int b)
{