Lines Matching refs:max
44 int max;
54 * min:max[:mult]
56 * any of the values may be blank (ie. min::mult, :max, etc.) and default
62 * which is malloc'd by the routine. The min, max, and mult entries of each
72 * defmax default value to plug in for max, if it is missing
75 * can call to parse the min, max, and mult strings. This
134 rp->max = defmax;
165 * Process the 'max' field - if one was not present (n1 format)
166 * set max equal to min. If the field was present, but
172 rp->max = rp->min;
174 if ((*parse_func) (n2str, &rp->max) < 0) {
233 * Three simple functions to return the min, max, and mult values for a given
245 return ((struct range *)rbuf)[r].max;
278 long random_range(int min, int max, int mult, char **errp)
301 orig_max = max;
305 * switch min/max if max < min
308 if (max < min) {
309 tmp = max;
310 max = min;
321 if ((r = max % mult)) /* reduce to the next lower 'mult' multiple */
322 max -= r;
324 if (min > max) { /* no 'mult' multiples between min & max */
338 nmults = ((max - min) / mult) + 1;
341 * If max is less than 2gb, then the value can fit in 32 bits
344 if (max <= (long)2147483647) {
348 * max is greater than 2gb - meeds more than 32 bits.
352 randnum = divider(min, max, 0, -1);
365 long random_rangel(long min, long max, long mult, char **errp)
388 orig_max = max;
392 * switch min/max if max < min
395 if (max < min) {
396 tmp = max;
397 max = min;
408 if ((r = max % mult)) /* reduce to the next lower 'mult' multiple */
409 max -= r;
411 if (min > max) { /* no 'mult' multiples between min & max */
425 nmults = ((max - min) / mult) + 1;
428 * If max is less than 2gb, then the value can fit in 32 bits
431 if (max <= (long)2147483647) {
435 * max is greater than 2gb - meeds more than 32 bits.
439 randnum = divider(min, max, 0, -1);
451 long long random_rangell(long long min, long long max,
476 orig_max = max;
480 * switch min/max if max < min
483 if (max < min) {
484 tmp = max;
485 max = min;
496 if ((r = max % mult)) /* reduce to the next lower 'mult' multiple */
497 max -= r;
499 if (min > max) { /* no 'mult' multiples between min & max */
513 nmults = ((max - min) / mult) + 1;
515 * If max is less than 2gb, then the value can fit in 32 bits
518 if (max <= (long)2147483647) {
523 * max is greater than 2gb - meeds more than 32 bits.
526 randnum = divider(min, max, 0, -1);
534 * number min and max. It was designed to work the 64bit numbers
537 * find the difference between min and max (max-min).
539 * Determine the midway point between min and max.
540 * if the midway point is less than 2g from min or max,
543 * Otherwise, call outself with min and max being min and midway value or
544 * midway value and max. This will reduce the range in half.
547 divider(long long min, long long max, long long cnt, long long rand)
566 diff = max - min;
571 half = diff / (long long)2; /* half the distance between min and max */
572 med = min + half; /* med way point between min and max */
575 printf("divider: min=%lld, max=%lld, cnt=%lld, rand=%lld\n", min, max,
583 * to pick the number within the min to med or med to max
596 return divider(med, max, cnt + 1, rand);
805 printf(" min=%ld, max=%ld\n", ltmin, ltmax);
845 printf(" min=%lld, max=%lld\n", lltmin, lltmax);
885 printf(" min=%d, max=%d\n", itmin, itmax);