HP OpenVMS Systems

Ask the Wizard

HP OpenVMS Systems

OpenVMS information

» What's new on our site
» Upcoming events
» Configuration and buying assistance
» Send us your comments

HP OpenVMS systems

» OpenVMS software
» Supported Servers
» OpenVMS virtualization
» OpenVMS solutions and partners
» OpenVMS success stories
» OpenVMS service and support
» OpenVMS resources and information
» OpenVMS documentation
» Education and training

Quick Links

» Non-javascript page
» Ask the Wizard

Test Drive OpenVMS

» OpenVMS I64 test drive
» Java test drive

Other information resources available to you include:

» OpenVMS freeware
» ECO kits, software and hardware support, prior version support
» Alpha SRM, ARC, and AlphaBIOS firmware updates
» ENCOMPASS - HP user group
» OpenVMS software downloads, OpenVMS freeware CD-ROM
» OpenVMS firmware locations
» DECconnect passive adaptor charts
» Cables reference guide
» MicroVAX console commands
» OpenVMS student research

Select a topic below to see Questions Frequently Asked by partners

» Using the online documentation library(installing BNU from the asap SDK)
» Global sections(how to create and use.)
» xx$CREATE_BUFOBJ system service(usage)
» Ethernet address(methods of determination)
» Shareable images(cookbook approach to creating one)
» Sharing data/code at absolute addresses(a guide with examples)
» Determining the Alpha microprocessor
» Using GETSYI to get hardware status

Evolving business value

» Business Systems Evolution
» AlphaServer systems transition planning
» Alpha RetainTrust program

Related links

» HP Integrity servers
» HP Alpha systems
» HP storage
» HP software
» HP products and services
» HP solutions
» HP support
disaster proof
HP Integrity server animation
HP Integrity server animation
Content starts here

Ask the Wizard Questions

Random Number Generator in OpenVMS VAX v6.1

The Question is:

Dear Wizards,

I have two questions, actually. The first is I am a Game Programmer and I would like to know if there is a way to get Random Numbers in OpenVMS VAX v6.1.

If there is could you mail it to me?

The second Question is I was wondering if you could send me some programs that you use. This would help me greatly, and I would love to have them.

Thank You for your time.

The Answer is:

The standard runtime library contains a routine which implements a mixed congruential method random number generator. By all accounts it's an excellent generator. Of course it's quite simple to code your own. MTH$RANDOM is only 9 machine instructions long, maybe 4 or 5 lines of code in a high level language. Check out a good textbook on the subject. Although it's very old, the definitive work is still "The Art of Computer Programming, Vol 2, Seminumerical Algorithms, Donald E. Knuth, Addison Wesley, 1969(!)"

Here's what HELP has to say about the routine:

$ help rtl mth$ mth$random




The Random-Number Generator, Uniformly Distributed routine is a general random-number generator.





VMS usage: longword_unsigned

type: longword (unsigned)

access: modify

mechanism: by reference

The integer seed, a 32-bit number whose high-order 24 bits are converted by MTH$RANDOM to an F_floating random number. The seed argument is the address of an unsigned longword that contains this integer seed. The seed is modified by each call to MTH$RANDOM.

Most languages implemented on OpenVMS also have their own run time library routine for generating random numbers. See your language documentation for details.

The Answer to the second question is:

I'm not sure what you're asking here - most of the programs I use regularly are commercial products. It works like this: you send us money, we send you the program (source code is extra, *LOTS* extra). If you're looking for sample programs, I'd suggest the Freeware CD, the DECUS library, DSNlink, or the various web sites.