15#ifndef DRACO_CORE_MATH_UTILS_H_
16#define DRACO_CORE_MATH_UTILS_H_
24#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
36 uint64_t act_number = number;
37 uint64_t square_root = 1;
38 while (act_number >= 2) {
47 square_root = (square_root + number / square_root) / 2;
53 }
while (square_root * square_root > number);
61 typename std::enable_if<std::is_integral<DataTypeT>::value &&
62 std::is_signed<DataTypeT>::value>::type * =
nullptr>
64 typedef typename std::make_unsigned<DataTypeT>::type DataTypeUT;
65 return static_cast<DataTypeT
>(
static_cast<DataTypeUT
>(a) +
66 static_cast<DataTypeUT
>(b));
69template <
typename DataTypeT,
70 typename std::enable_if<!std::is_integral<DataTypeT>::value ||
71 !std::is_signed<DataTypeT>::value>::type * =
Definition attribute_octahedron_transform.cc:21
uint64_t IntSqrt(uint64_t number)
Definition math_utils.h:31
DataTypeT AddAsUnsigned(DataTypeT a, DataTypeT b)
Definition math_utils.h:63