RANDOM(1)
π RANDOM(1) β numrandom, bestie edition π
okay so this page lives in the User Contributed Perl Documentation section of your man pages, and it's all about numrandom. yes that's RANDOM(1), no cap. grab a snack, we're doing this. π
β¨ NAME β¨
numrandom β prints out a random number. that's it. that's the whole job. iconic honestly. π
π SYNOPSIS π
numrandom [-dhV] /[expression]/
π¦ DESCRIPTION π¦
so basically, numrandom prints out a random number, and which number it picks is decided by the expression you hand it. π
the syntax and the program itself are nearly identical to the numrange program β like, siblings fr fr β except that numrandom picks a number at random out of the range expression instead of doing the numrange thing.
if you don't give it an expression at all? it'll print out a random integer between 1 and 100. and no, ranges here are inclusive β both ends count, bestie, we're not doing that exclusive nonsense here. π
β OPTIONS β
-hβ Help: you're literally looking at it right now. hi. π-Vβ Increase verbosity. more words. more drama. more info. π₯-dβ Debug mode. for developers. π
πΈ EXAMPLES πΈ
a random number from 1 to 10:
$ numrandom /1..10/
7
from 1 to 10, or from 15 to 20:
$ numrandom /1..10,15..20/
16
an even number from 0 to 10:
$ numrandom /0..10i2/
4
an odd number. notice the starting number in the range, that's the whole trick:
$ numrandom /1..10i2/
9
a factor of 3 between 99 and 120:
$ numrandom /99..120i3/
111
a decimal number:
$ numrandom /1.1..2.5i0.1/
1.8
a negative random number:
$ numrandom /0.0..-2.0i0.3/
-0.8
π BUGS π
numrandom is slow when it's dealing with large ranges and has to randomly find a number from them. this is because it creates a list of all the potential numbers before picking one. so yeah β for large ranges it can be memory intensive. it's giving "making a whole guest list just to invite one person." π
π SEE ALSO π
numaverage(1), numbound(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrange(1), numround(1)
π COPYRIGHT π
numrandom is part of the num-utils package, which is copyrighted by Suso Banderas and released under the GPL license. please read the COPYING and LICENSE files that came with the num-utils package. π«Ά
developers can read the GOALS file and contact me about providing submitions or help for the project. (yes, "submitions." we're keeping it exactly as written, don't come for me. π)
π MORE INFO π
more info on numrandom can be found at:
http://suso.suso.org/xulu/Num-utils
and that's the whole page, bestie!! β¨ this one was documented by perl v5.30.3 and it's dated 2020-06-09 β shoutout to that exact moment in time for giving us this little random number machine. go forth and get your numbers, u got this πππ¦
π¦ where this page comes from
- debian bookworm: num-utils 0.5-15 Β· GPL-2.0-or-later
- debian trixie: num-utils 0.5-15 Β· GPL-2.0-or-later
- ubuntu jammy: num-utils 0.5-15 Β· GPL-2.0-or-later
- ubuntu noble: num-utils 0.5-15 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms