lemon/random.h
changeset 1172 d7e25df22e88
parent 1143 f70f688d9ef9
equal deleted inserted replaced
29:9d55bbb37dcb 30:967116e4e2ed
   340           ::mask(max);
   340           ::mask(max);
   341         Word num;
   341         Word num;
   342         do {
   342         do {
   343           num = rnd() & mask;
   343           num = rnd() & mask;
   344         } while (num > max);
   344         } while (num > max);
   345         return num;
   345         return static_cast<Result>(num);
   346       }
   346       }
   347     };
   347     };
   348 
   348 
   349     template <typename Result, int exp>
   349     template <typename Result, int exp>
   350     struct ShiftMultiplier {
   350     struct ShiftMultiplier {