Function templates
Updated 28 Aug 2023
In the Edit Algorithmic Values window, you can enter functions in the Constraint Value column. The Custom Question Builder comes with a number of function templates that you can enter in your constraint specifications. To do so:
- In the Constraint Value column, select and then right-click on the row where you want to insert a function.
- Enter the function template as shown in the lists below.
- Replace the default variables shown in the template with your algorithmic values.
The following tables explain the different function templates.
Function |
Description |
Example |
ABS(X) |
Absolute value of X |
ABS(-3.75) = 3.75 |
DIV(A,B) |
Integer part of the division A/B |
DIV(7,2) = 3 |
CEIL(A) |
Rounds the number A to the smallest integer not less than the given number |
CEIL(2.93) = 3 |
FLOOR(A) |
Rounds the number A to the largest integer not greater than the given number |
FLOOR(2.93) = 2 |
GCF(A,B) |
Greatest common factor of A and B |
GCF(6,8) = 2 |
IFTHEN(A,B,C) |
If condition A is true, then the algorithmic value equals B; otherwise, it equals C |
|
LCM(A,B) |
Least common multiple of A and B |
LCM(6,8) = 24 |
MIN(A,B) |
Minimum of A and B |
MIN(6,8) = 6 |
MAX(A,B) |
Maximum of A and B |
MAX(6,8) = 8 |
MOD(A,B) |
Modulus, or remainder, of the division of A/B |
MOD(11,3) = 2 |
RTX(N,X) |
nth root of X |
RTX(4,16) = 2 |
ROUND(X,P) |
Round X to P places |
ROUND(3.14159,-3) = 3.142 |
SQRT(X) |
Square root of X |
SQRT(16) = 4 |
TRUNC(X,P) |
Truncate X to P places |
TRUNC(3.14159,-3) = 3.141 |
SIMPAB(A,B) |
Divide A by the GCF of A and B |
SIMPAB(6,8) = 3 |
SIMPBA(A,B) |
Divide B by the GCF of A and B |
SIMPBA(6,8) = 4 |
GCS(X) |
Find the square root of the largest perfect square in X |
GCS(18) = 3 |
GCSR(X) |
Find the remaining factor after finding GCS(X) |
GCSR(18) = 2 |
FRAC2MNUM(A,B,C) |
When the value of C is any non-zero number, the fraction part of the mixed number is fully reduced. When C is 0 or not included, then the fraction is not fully reduced. |
FRAC2MNUM (10,4,0) = 2 2/4 FRAC2MNUM (10,4,1) = 2 1/2 |
Function |
Description |
Example |
SIN(X) |
Sine of X (X must be in radians, result is a decimal) |
SIN(PI/6) = 0.5 |
COS(X) |
Cosine of X (X must be in radians, result is a decimal) |
COS(PI/6) = 0.866025403784 |
TAN(X) |
Tangent of X (X must be in radians, result is a decimal) |
TAN(PI/4) = 0.577350269190 |
ARCSIN(X) |
Arc sine of X (X must be in the interval [-1, 1], result is in radians) |
ARCSIN(0.5) = 0.523598775598 |
ARCCOS(X) |
Arc cosine of X (X must be in the interval [-1, 1], result is in radians) |
ARCCOS(0.5) = 1.047197551197 |
ARCTAN(X) |
Arc tangent of X (X must be a real number, result is in radians) |
ARCTAN(0.5) = 0.463647609001 |
SEC(X) |
Secant of X (X must be in radians, result is a decimal) |
SEC(PI/6) = 1.155 |
CSC(X) |
Cosecant of X (X must be in radians, result is a decimal) |
CSC(PI/6) = 2 |
COT(X) |
Cotangent of X (X must be in radians, result is a decimal) |
COT(PI/6) = 1.732 |
ARCSEC(X) |
Arc secant of X (X must be in radians, result is a decimal) |
ARCSEC(PI) = 1.247 |
ARCCSC(X) |
Arc cosecant of X (X must be in radians, result is a decimal) |
ARCCSC(PI) = 0.324 |
ARCCOT(X) |
Arc cotangent of X (X must be in radians, result is a decimal) |
ARCCOT(PI) = 0.308 |
Function |
Description |
Example |
EXP(X) |
e^x (result is a decimal) |
EXP(2) = 7.389056098931 |
LN(X) |
Log base e of X (Natural Log) |
LN(e) = 1 |
LOG(X) |
Log base 10 of X (Common Log) |
LOG(100) = 2 |
LOGX(N,X) |
Log base N of X |
LOGX(3,81) = 4 |
You can also add these functions manually. Be sure to include the $ at the beginning of these functions.
Function |
Description |
$Mean(x1,x2,…,xn) |
Returns the mean of a series of numbers |
$Median(x1,x2,…,xn) |
Returns the median of a series of numbers |
$Mode(x1,x2,…,xn) |
Returns the mode of a series of numbers |
$NormCurve(mu,sd,x) |
Returns the value on a normal curve with a given mean and standard deviation at x |
$NormDist(x) |
Returns the cumulative area under standard normal curve from far left to x |
$StdDev(x1,x2,…xn) |
Returns the standard deviation of a dataset or series of numbers |
Function |
Description |
Example |
$PV(interest, number of years, annual payments) |
Returns the present value of annual constant payments. Interest is an algorithmic value in decimal format.
|
$PV(0.02, 10, 100 |
$IRRannuity(initial investment, constant annuity, number of periods) |
Returns the internal rate of return of a series of constant payments. You do not need to enter the initial investment as a negative number. The computed IRR is given in decimal format. (such as, 0.056) |
$IRRannuity(10000, 2000, 6) |
Function |
Description |
Example |
PERM(N,R) |
Permutation of R objects chosen from N distinct objects without repetition |
P(7,3) = 210 |
COMB(N,R) |
Combination of N distinct objects chosen R at a time |
COMB(7,3) = 35 |