posible error in uniform_smallint_integer

Hi, I want to toss a coin in c++. I don't want to use variate_generator because my program use it many million times. The code is: boost::mt19937 mt; boost::detail::uniform_smallint_integer<boost::mt19937, bool> coin(mt, false, true); and the error (with gdb) is: boost::detail::uniform_smallint_integer<boost::random::mersenne_twister<unsigned int, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18, 3346425566u>, bool>::operator() (this=0x804d9e4) at /usr/include/boost/random/uniform_smallint.hpp:67 67 return (((*_rng)() - (_rng->min)()) / _factor) % _range + _min; because _factor = 0 and we don't know to divide by 0, aren't we? Is this a bug or am I doing something wrong? thanks for your time :) Gustavo -- Gustavo Romero López Arquitectura y Tecnología de Computadores E.T.S.I. Informática. Universidad de Granada Tel: 958 240589 Fax: 958 248993
participants (1)
-
Gustavo Romero