40 return (
in >= 0) ?
in : -
in;
52 int64_t product =
static_cast<int64_t
>(inArg0) * inArg1;
55 uint32_t upper = (product >> 47);
72 result += (product & 0x8000) >> 15;
83#define clz(x) (__builtin_clzl(x) - (8 * sizeof(long) - 32))
85static uint8_t
clz(uint32_t x)
90 while (!(
x & 0xF0000000))
95 while (!(
x & 0x80000000))
114 uint64_t quotient = 0;
120 if (divider & 0xFFF00000)
122 uint32_t shifted_div = (divider >> 17) + 1;
123 quotient = remainder / shifted_div;
124 uint64_t tmp = (quotient *
static_cast<uint64_t
>(divider)) >> 17;
125 remainder -=
static_cast<uint32_t
>(tmp);
129 while (!(divider & 0xF) && bit_pos >= 4)
135 while (remainder && bit_pos >= 0)
144 uint32_t
div = remainder / divider;
145 remainder = remainder % divider;
146 quotient +=
static_cast<uint64_t
>(
div) << bit_pos;
148 if (
div & ~(0xFFFFFFFF >> bit_pos))
161 if ((
a ^ b) & 0x80000000)
const fix16_t fix16_minimum
fix16_t fix16_div(fix16_t a, fix16_t b)
fix16_t fix16_mul(fix16_t inArg0, fix16_t inArg1)
static uint32_t fix_abs(fix16_t in)
static uint8_t clz(uint32_t x)
const fix16_t fix16_overflow
double div(const double &fNumerator, const double &fDenominator)