jot.c (c06e7b66a147edf55f4241fbfbfa32856550cd15) jot.c (814f2cd84c5a7cbe52b99d13326ea5ba5078f976)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 249 unchanged lines hidden (view full) ---

258 case HAVE_REPS | HAVE_BEGIN | HAVE_STEP:
259 if (randomize)
260 ender = ENDER_DEF;
261 else
262 ender = begin + reps * s - s;
263 mask = 0;
264 break;
265 case HAVE_REPS | HAVE_BEGIN | HAVE_ENDER:
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 249 unchanged lines hidden (view full) ---

258 case HAVE_REPS | HAVE_BEGIN | HAVE_STEP:
259 if (randomize)
260 ender = ENDER_DEF;
261 else
262 ender = begin + reps * s - s;
263 mask = 0;
264 break;
265 case HAVE_REPS | HAVE_BEGIN | HAVE_ENDER:
266 if (reps == 0)
267 errx(1, "infinite sequences cannot be bounded");
268 else if (reps == 1)
269 s = 0.0;
270 else
271 s = (ender - begin) / (reps - 1);
266 if (!randomize) {
267 if (reps == 0)
268 errx(1, "infinite sequences cannot "
269 "be bounded");
270 else if (reps == 1)
271 s = 0.0;
272 else
273 s = (ender - begin) / (reps - 1);
274 }
272 mask = 0;
273 break;
274 case HAVE_REPS | HAVE_BEGIN | HAVE_ENDER | HAVE_STEP:
275 /* if reps given and implied, */
276 if (!randomize && s != 0.0) {
277 long t = (ender - begin + s) / s;
278 if (t <= 0)
279 errx(1, "impossible stepsize");

--- 235 unchanged lines hidden ---
275 mask = 0;
276 break;
277 case HAVE_REPS | HAVE_BEGIN | HAVE_ENDER | HAVE_STEP:
278 /* if reps given and implied, */
279 if (!randomize && s != 0.0) {
280 long t = (ender - begin + s) / s;
281 if (t <= 0)
282 errx(1, "impossible stepsize");

--- 235 unchanged lines hidden ---