[comp.unix.ultrix] rand

tyers@trlluna.trl.oz (P Tyers) (04/21/88)

Having just installed Ultrix32 V2.2 on our newly acquired VAX3600's
I decided to try out the "supported product" ULTMH022, the Rand Mail Handler
MH. As usual the load went well BUT no man entries and no paper manuals that
I can find. OK we have a DECsupport contract - contact DEC in Australia -
referred to their despatch department - 'If its not on the packing list you
dont get it!' was the only answer. ALL THIS FOR $A1000 per month.

Extinquish flamethrower --- My serious query, has anybody located the manuals
for MH under Ultrix V2.2 or do I have to get them from an ftp or equivalent
source? Did DEC foul it up? As supplied whatis indicates manual entries exist
in sections 1, 5 and 8 (the latter I will not swear to). However no man 
entries exist, catman deletes the erroneous references. Have I missed something?

I live in hope and thanks in advance

-- 
P Tyers,	           JANET tyers%trlluna.oz@uk.ac.ucl.cs
ACSnet 	tyers@trlluna.oz   UUCP {uunet,hplabs,ukc}!munnari!trlluna.oz!tyers
CSnet	tyers@trlluna.oz   ARPAnet tyers%trlluna.oz@uunet.uu.net
MAIL: Telecom Research Laboratories, P.O. Box 249, Clayton, VICTORIA 3168,AUST





[ I have installed MH 6.4 which I obtained from the 4.3 BSD tape.  It
  came with a full set of manual pages.  I also have the three inch stack
  of paper documentation which came with MH 6.1 from the University of
  California at Irvine.  If you don't find documentation anywhere else,
  I will be glad to arrange copies of either or both for you.   -- Art Z. ]

avolio@decuac.dec.com (Frederick M. Avolio) (04/23/88)

The MH Mail program is NOT a supported product (although under UWS, XMH *is*
supported and no I will not explain that as I cannot!).  This is why it is
not in the documentation.  We haven't put the documentation for things under
/usr/new in the printed manual set, although the on line documentation is
available in ULXMAN* subset.

Fred

josevela@academ01.mty.itesm.mx (Jose Angel Vela Avila) (01/30/91)

  I have been trying the rand() function, but seems don't work...


  I'm on a Vax 6310 with Ultrix 3.0, rand() returns me values too much hi..


  Is there a trick ?

Thanks..

mogul@wrl.dec.com (Jeffrey Mogul) (02/05/91)

In article <josevela.665174097@academ01> josevela@academ01.mty.itesm.mx (Jose Angel Vela Avila) writes:
>  I have been trying the rand() function, but seems don't work...
>
>  I'm on a Vax 6310 with Ultrix 3.0, rand() returns me values too much hi..
>
>  Is there a trick ?

The rand() function is defined as returning an integer in the range
between 0 and (2^31)-1, inclusive.  Since the upper end of the range
is the largest possible (signed) integer, there is no possible return
value that is "too high".

If what you mean is that you don't WANT values larger than some
value of your choosing ... the usual trick is to do

myrand(x)
int x;
{
	return (rand() % x);
}

which returns an integer between 0 and x-1, inclusive.

But you really should be using the random() function, rather
than rand().  Using rand() this way will produce non-random results.
See the manual page for random(3).

-Jeff