Lines Matching +full:max +full:- +full:cur
2 /*-
3 * SPDX-License-Identifier: BSD-2-Clause
48 #define MAX(a, b) (((a) < (b))? (b) : (a)) macro
49 #define ISSIGN(c) ((int)(c) == '-' || (int)(c) == '+')
62 {"equal-width", no_argument, NULL, 'w'},
89 double first, last, incr, prev, cur, step; in main() local
102 if (locale && locale->decimal_point && locale->decimal_point[0] != '\0') in main()
103 decimal_point = locale->decimal_point; in main()
110 (c = getopt_long(argc, argv, "+f:hs:t:w", long_opts, NULL)) != -1) { in main()
135 argc -= optind; in main()
142 "usage: %s [-w] [-f format] [-s string] [-t string] [first [incr]] last\n", in main()
147 last = e_atof(argv[argc - 1]); in main()
161 incr = (first < last) ? 1.0 : -1.0; in main()
182 for (step = 1, cur = first; incr > 0 ? cur <= last : cur >= last; in main()
183 cur = first + incr * step++) { in main()
186 printf(fmt, cur); in main()
187 prev = cur; in main()
194 * computed value ('cur') and desired 'last' value are equal. If they in main()
195 * are equal after formatting truncation, but 'cur' and 'prev' are not in main()
199 if (asprintf(&cur_print, fmt, cur) < 0 || in main()
224 * numeric - verify that string is numeric
261 * valid_format - validate user specified format string
283 while (*fmt != '\0' && strchr("#0- +'", *fmt)) { in valid_format()
319 /* PR 236347 -- user format strings must have a conversion */ in valid_format()
324 * unescape - handle C escapes in a string
382 c |= (*cp - '0'); in unescape()
385 --cp; in unescape()
394 c |= (*cp - '0'); in unescape()
396 c |= ((toupper((unsigned char)*cp) - in unescape()
400 --cp; in unescape()
403 --cp; in unescape()
412 * e_atof - convert an ASCII string to a double
433 if (dbl == -0.0) in e_atof()
439 * decimal_places - count decimal places in a number (string)
458 * generate_format - create a format string
475 last = first - incr * floor((first - last) / incr); in generate_format()
477 last = first + incr * floor((last - first) / incr); in generate_format()
488 width1 -= (places + strlen(decimal_point)); in generate_format()
490 precision = MAX(places, precision); in generate_format()
496 width2 -= (places + strlen(decimal_point)); in generate_format()
500 MAX(width1, width2) + (int) strlen(decimal_point) + in generate_format()
503 sprintf(buf, "%%%c%d%c", pad, MAX(width1, width2), in generate_format()