Boost logo

Boost :

From: Gustavo Romero (gustavo_at_[hidden])
Date: 2006-01-25 08:24:58


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:
int, 32, 624, 397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u,
18, 3346425566u>, bool>::operator() (this=0x804d9e4) at
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 Romero López
Arquitectura y Tecnología de Computadores
E.T.S.I. Informática. Universidad de Granada
Tel: 958 240589              Fax: 958 248993

Boost list run by bdawes at, gregod at, cpdaniel at, john at