File: rng

package info (click to toggle)
libmath-gsl-perl 0.45-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192,156 kB
  • sloc: ansic: 895,524; perl: 24,682; makefile: 12
file content (12 lines) | stat: -rwxr-xr-x 275 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl -w

use strict;
use Math::GSL::RNG qw/:all/;

my $rng = Math::GSL::RNG->new($gsl_rng_knuthran, int rand(1e5) );
my ($num,$min,$max) = @ARGV;
$num ||= 10;
$min ||= 0;
$max ||= 100;

print join("\n", map { $min + $rng->get % ($max-$min+1)  } (1..$num)) . "\n";