Sponsored Content
Full Discussion: mod on %RANDOM
Top Forums Shell Programming and Scripting mod on %RANDOM Post 302272029 by radoulov on Monday 29th of December 2008 10:42:05 AM
Old 12-29-2008
Thank you for elaborating further, Perderabo!
 

3 More Discussions You Might Find Interesting

1. Programming

Mod

I try to use mod(a,b) in a program but i cant Please help me (2 Replies)
Discussion started by: iwbasts
2 Replies

2. Ubuntu

expect script for random password and random commands

Hi I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue: I want expect script for random passwords and random commands generation. please can anyone help me? Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies

3. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies
rand(3C)																  rand(3C)

NAME
rand(), rand_r(), srand() - simple random-number generator SYNOPSIS
DESCRIPTION
uses a multiplicative, congruential, random-number generator with period 2^32 that returns successive pseudo-random numbers in the range from 0 to 2^15-1. can be called at any time to reset the random-number generator to a random starting point. The generator is initially seeded with a value of 1. returns a random number at the address pointed to by the randval parameter. The seed parameter can be set at any time to start the random- number generator at an arbitrary point. Note The spectral properties of leave a great deal to be desired. provides a much better, though more elaborate, random-number generator (see drand48(3C)). RETURN VALUE
If seed or randval is NULL, returns 0. Otherwise, returns a psuedo-random integer. EXAMPLES
The following: int x, y; srand(10); x = rand(); y = rand(); would produce the same results as: int x, y, s = 10; x=rand_r(&s); y=rand_r(&s); WARNINGS
Users of should note that rand_r() now conforms with POSIX.1c. The old prototype of is supported for compatibility with existing DCE applications only. SEE ALSO
drand48(3C), random(3M), thread_safety(5), random(7). STANDARDS CONFORMANCE
rand(3C)
All times are GMT -4. The time now is 04:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy