jot.c (0ad736e62b3f8c5d8ae242610ba2ab9786d92e59) | jot.c (bbc7056be81b9ca9990e68081710f90f943e47f1) |
---|---|
1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 261 unchanged lines hidden (view full) --- 270 default: 271 errx(1, "bad mask"); 272 } 273 if (reps == 0) 274 infinity = 1; 275 if (randomize) { 276 *x = (ender - begin) * (ender > begin ? 1 : -1); 277 for (*i = 1; *i <= reps || infinity; (*i)++) { | 1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 261 unchanged lines hidden (view full) --- 270 default: 271 errx(1, "bad mask"); 272 } 273 if (reps == 0) 274 infinity = 1; 275 if (randomize) { 276 *x = (ender - begin) * (ender > begin ? 1 : -1); 277 for (*i = 1; *i <= reps || infinity; (*i)++) { |
278 *y = arc4random() / (double)UINT32_MAX; | 278 *y = arc4random() / ((double)UINT32_MAX + 1); |
279 if (putdata(*y * *x + begin, reps - *i)) 280 errx(1, "range error in conversion"); 281 } 282 } else 283 for (*i = 1, *x = begin; *i <= reps || infinity; (*i)++, *x += s) 284 if (putdata(*x, reps - *i)) 285 errx(1, "range error in conversion"); 286 if (!nofinalnl) --- 164 unchanged lines hidden --- | 279 if (putdata(*y * *x + begin, reps - *i)) 280 errx(1, "range error in conversion"); 281 } 282 } else 283 for (*i = 1, *x = begin; *i <= reps || infinity; (*i)++, *x += s) 284 if (putdata(*x, reps - *i)) 285 errx(1, "range error in conversion"); 286 if (!nofinalnl) --- 164 unchanged lines hidden --- |