NAME frnd - a fast and dirty random generator. SYNOPSIS int *frnd([int MAX [, int MIN [, int NR [, int SEED]]]]) DESCRIPTION This is a fast (well, it's LPC) and dirty random number generator that will produce an array of random numbers. The periodicity is only about 2**30, which is considered quite bad. The routine returns a sequence of NR consecutive random integers in an array. The numbers are all in the range [MIN, MAX] (i.e. including both MIN and MAX in the range). The SEED is used to set the starting point of the sequence. It is a good idea to keep SEED in the interval [MIN, MAX]. EXAMPLES frnd(100, 0, 5, 0) gives ({ 21, 20, 0, 66, 70 }) frnd(1, 0, 5, 0) gives ({ 0, 0, 0, 1, 1 }) frnd(1, -1, 5, 1) gives ({ -1, 1, 1, 0, 1 }) NOTA BENE There are no sanity checks on things here, as that would slow it down and LPC is slow enough as it is, even on a good day. Thus, it is YOUR responsibility to give valid values. BUGS If you demand a very big array, strange buffers might overflow or you can get the dreaded 'Too long evaluation' error message.
Help topics available:
_get_all_obj | _next_obj | _prev_obj | abs | expand_file_name |
frnd | get_objects | getopts | implode_nicely | itoa |
line_break | load_object | mapping_rusage | query_ip_name | set_light |
sgn | short_date | typep |
You are guest number 97 since January 2020.
This file was last modified: June 2000.