Closed
Description
static inline uint64_t util_mul_div64(uint64_t num, uint64_t mul, uint64_t div)
{
#if defined(_MSC_VER) && defined(_M_X64) && (_MSC_VER >= 1920)
unsigned __int64 high;
const unsigned __int64 low = _umul128(num, mul, &high);
unsigned __int64 rem;
return _udiv128(high, low, div, &rem);
#else
const uint64_t rem = num % div;
return (num / div) * mul + (rem * mul) / div;
#endif
}
error : use of undeclared identifier '_udiv128'
tested with llvm-msvc-v777.1.9
Metadata
Metadata
Assignees
Labels
No labels