/*
 * Copyright (1987) Jeff Elman.  University of California, San Diego
 * This software may be redistributed without charge; this notice
 * should be preserved.
 */

#ifdef X
/*
 * roll.c
 *
 * return 1 if number is >= than a randomly rolled number,
 * else return 0.  The number will be a floating point activation.
 * The effect of this will be to treat the activation as a percentage,
 * and to return 1 that percentage of the time.
 */
roll(number)
	double	number;
{
	extern long random();
	double	max = 2147483647;
	double	new;

	/*
	 * divide by maximum in order to scale between 0 and 1
	 */
	new = (double) random() / max;
	if (number >= new)
		return 1;
	else
		return 0;
}
#endif
