The following mathematical functions can be used by a designer in the formula of a calculated quiz question.
 

Supported Function Description Available in WebCT version
( ) Parentheses, used to group elements for precedence All
+ Add All
- Subtract All
* Multiply All
/ Divide All
** Exponent. For example, 2**3 = 8 All
% Modulus or remainder. For example, 10%3 = 1 CE 3.8 and later
! see fact(x) CE 3.8 and later
abs(x) Absolute value. For example, abs(-3) = 3 All
acos(x)

Arc cosine (calculated in radians).
Tip: If acos(x) is not available in your version of WebCT, use atan2(sqrt(1-x**2),x)

CE 3.8 and later
asin(x)

Arc sine (calculated in radians).
Tip: If asin(x) is not available in your version of WebCT, use atan2(x, sqrt(1-x**2))

CE 3.8 and later
atan(x) Arc tangent (calculated in radians).
See also Note 2.
Tip: If atan(x) is not available in your version of WebCT, use atan2(x,1)
CE 3.8 and later
atan2(x,y) Arc tangent. Calculates the arctangent, in radians, of the two variables x and y. It is similar to calculating the arc tangent of x / y, except that the signs of both arguments are used to determine the quadrant of the result. See also Note 2.   All
ceil(x) ceil(x) rounds x up to the nearest integer.
For example, ceil(-2.34) = -2
CE 3.8 and later
cos(x) Cosine. Calculates the cosine of x where x is measured in radians. See also Note 2. All
cosh(x) cosh(x) returns the hyperbolic cosine of x, which is defined mathematically as (exp(x) + exp(-x)) / 2
CE 3.8 and later
exp(x) Natural exponent, ex. For example, exp(1) = 2.71828 All
fact(x)
x!

Factorial. For example, fact(3) = 3! = 3*2*1 = 6
Note
: The maximum factorial allowed is 170!. On some systems, a component of an equation may be as high as 1754!, but the result must not exceed 170!. In addition, accuracy will reduce as the numbers grow.

CE 3.8 and later
floor(x) floor(x) rounds x down to the nearest integer.
For example, floor(-2.34) = -3
CE 3.8 and later
int(x) Integer portion of expression. For example: int(5.99) = 5; int(-3.99) =  -3. All
ln(x) Natural logarithm. CE 3.8 and later
log(x) Natural logarithm, loge(x) or ln(x). For example, log(2.71828) = 1 All
log10(x) Base-10 logarithm.
Tip: If log10(x) is not available your version of WebCT, use log(x)/log(10)
CE 3.8 and later
max(x,y,…) The maximum of the parameters.
For example, max(1,5,3,2) = 5
CE 3.8 and later
min(x,y,…) The minimum of the parameters.
For example, min(1,5,3,2) = 1
CE 3.8 and later
round(d,x) Rounds x to d decimal places. Halfway cases round away from zero.
For example, round(0,1.5) = 2; round(0,-2.5) = -3; round(2,-2.666) = -2.67; round(-3,5555) = 6000
CE 3.8 and later
sin(x) Sine. Calculates the sine of x where x is measured in radians. See also Note 2. All
sinh(x) sinh(x) returns the hyperbolic sine of x,
which is defined mathematically as
(exp(x) - exp(-x)) / 2.
CE 3.8 and later
sqrt(x) Square root. For example, sqrt(9) = 3 All
sum(:v,x,y,z)

Summation, where:

  • :v is the variable name, which is a colon (:) followed by a single letter.
  • x is the starting counter.
  • y is the ending counter.
  • z is the formula.

Example usage in a calculated quiz question:
Question: What is the sum of the squares of the numbers from {a} to {b}?
Formula: sum(:v,{a},{b},:v**2)

CE 3.8 and later
tan(x) Tangent. tan(x) is defined as sin(x)/cos(x). Calculates the tan of x where x is measured in radians. See also Note 2.
Tip: If tan(x) is not available in your version of WebCT, use sin(x)/cos(x)
CE 3.8 and later
tanh(x) Hyperbolic tangent. tanh(x) is defined as
(exp(x)-exp(-x))/(exp(x) + exp(-x))
CE 3.8 and later

Notes:

  1. When using variables for which WebCT substitutes values, you must specify the variables within braces, { }, in both the Question and Formula text boxes.
    For example:
  2. The angular values for trigonometric functions are expressed in radians not degrees. For conversion purposes, Pi radians = 180 degrees.
     
  3. Any parameter - except for the variable declaration of a sum formula - can be a nested formula.