tcod_sys/libtcod/src/mersenne_c.c
double TCOD_random_get_gaussian_double_range_inv (TCOD_random_t mersenne, double min, double max) {
	double mean, std_deviation, ret;
	if (min > max) {
		double tmp = max;
		max = min;
		min = tmp;
	}
	mean = (min + max) / 2.0;
	std_deviation = (max - min) / 6.0; /* 6.0 is used because of the three-sigma rule */
	ret = TCOD_random_get_gaussian_double_inv(mersenne, mean, std_deviation);
	return CLAMP(min,max,ret);
}
/* Box-Muller, ranges, inverted distribution */
Box-Muller, ranges, inverted distribution
Box - Muller ranges inverted distribution
double TCOD_random_get_gaussian_double_range_inv (TCOD_random_t mersenne, double min, double max) {
	double mean, std_deviation, ret;
	if (min > max) {
		double tmp = max;
		max = min;
		min = tmp;
	}
	mean = (min + max) / 2.0;
	std_deviation = (max - min) / 6.0; 
	ret = TCOD_random_get_gaussian_double_inv(mersenne, mean, std_deviation);
	return CLAMP(min,max,ret);
}
double TCOD_random_get_gaussian_double_range_inv ( TCOD_random_t mersenne , double min , double max ) { double mean , std_deviation , ret ; if ( min > max ) { double tmp = max ; max = min ; min = tmp ; } mean = ( min + max ) / 2.0 ; std_deviation = ( max - min ) / 6.0 ; ret = TCOD_random_get_gaussian_double_inv ( mersenne , mean , std_deviation ) ; return CLAMP ( min , max , ret ) ; }
Box-Muller, ranges, inverted distribution
Box - Muller ranges inverted distribution
/* 6.0 is used because of the three-sigma rule */