Lines Matching refs:bits
1116 int32_t NumberHelper::DoubleToInt(double d, size_t bits)
1121 if (exp < static_cast<int>(bits - 1)) {
1122 // smaller than INT<bits>_MAX, fast conversion
1124 } else if (exp < static_cast<int>(bits + DOUBLE_SIGNIFICAND_SIZE)) {
1125 // Still has significand bits after mod 2^<bits>
1126 // Get low <bits> bits by shift left <64 - bits> and shift right <64 - bits>
1128 << (static_cast<uint32_t>(exp) - DOUBLE_SIGNIFICAND_SIZE + INT64_BITS - bits)) >>
1129 (INT64_BITS - bits);
1135 // No significand bits after mod 2^<bits>, contains NaN and INF
1342 int32_t RandomGenerator::Next(int bits)
1345 return static_cast<int32_t>(val >> (INT64_BITS - bits));