Mathematical Functions


[Home][Index][Previous][Next]
The AppletQuiz applet supports a reasonably-full complement of basic mathematical functions:

For a complete list (with syntax) of the available mathematical functions, see the appendix to this document. For an explanation of AppletQuiz' randomizing functions, see below:


Randomizing Functions:

Since producing random values is the whole point of the exercise, most questions using numerical substitutions will need to use one (or both) of the randomizing functions supported by the applet. Note that the values produced are not truly random (since they are produced by a computer), but they are arbitrary enough for our purposes.


RND()

The RND() (or rnd()) function returns a "random" decimal value between 0 and 1. It takes no arguments. It is useful if you need a random decimal value, although you can get integer values, as shown below.


RNI(min, max)

The RNI (or rni) function returns "random" integer values between the integers "min" and "max" inclusive. It is useful when you want an integer value in a specified range.

{$R = RNI(1,3)} - The variable "R" gets a "random" integer value in the interval [1,3], that is, the value of "R" will be 1, 2, or 3.

{$R = RNI(0,100)} - "R" get a "random" integer in the interval [0, 100]. Both 0 and 100 are possibilities.

{$R = 10*RNI(1,5)} - "R" gets one of the values 10, 20, 30, 40, or 50.


[Home][Index][Previous][Next]
copyright © 1998 by Jerry L. Stanbrough - all rights reserved.
last update July 29, 1998 by JL Stanbrough (jstanbro@venus.net)