Built-In Functions

Constants

Constant

Value

E

2.7182818284590452354

FALSE

FALSE

INF

infinity

NINF

negative infinity

NO

FALSE

PI

3.14159265358979323846

TRUE

TRUE

YES

TRUE

 

Math and Statistical functions

Function Syntax

Type

Description

Usage

ABS(double)

double

Absolute value

ABS(-10) returns 10

ARCCOS(double)
ACOS(double)

double

Arc cosine

ARCCOS(0) returns 1.5707963267949

ARCCOSH(double)
ACOSH(double)

double

Hyperbolic arc cosine

ARCCOSH(2) returns 1.31695789692482

ARCCOT(double)
ACOT(double)

double

Arc cotangent

ARCCOT(1) returns 0.785398163397448

ARCCOTH(double)
ACOTH(double)

double

Hyperbolic arc cotangent

ARCCOTH(2.5) returns 0.423648930193602

ARCCSC(double)
ACSC(double)

double

Arc cosecant

ARCCSC(1) returns 1.5707963267949

ARCCSCH(double)
ACSCH(double)

double

Hyperbolic arc cosecant

ARCCSCH(4.5) returns 0.220432720979802

ARCSEC(double)
ASEC(double)

double

Arc secant

ARCSEC(1.5) returns 0.84106867056793

ARCSECH(double)
ASECH(double)

double

Hyperbolic arc secant

ARCSECH(.5) returns 1.31695789692482

ARCSIN(double)
ASIN(double)

double

Arc sine

ARCSIN(1) returns 1.5707963267949

ARCTAN(double)
ATAN(double)

double

Arc tangent

ARCTAN(1) returns 0.785398163397448

ARCTAN2(double y, double x)
ATAN2(double y, double x)

double

Arc tangent y/x

ARCTAN2(4,5) returns 0.674740942223553

ARCTANH(double)
ATANH(double)

double

Hyperbolic arc tangent

ARCTANH(.5) returns 0.549306144334055

AVERAGE(double, double, ...)
MEAN(double, double, ...)

double

Returns the average (arithmetic mean) of the arguments.

AVERAGE(1,3,5,7) returns 4

CEIL(double)

double

The smallest integer greater than or equal to the specified number

CEIL(4.1) returns 5

COMB(int x, int y)

int

Returns the number of possible combinations with a group of x objects grouped as y objects.

COMB(6,3) returns 20

COS(double)

double

The cosine of the given angle (in radians).

COS(PI) returns -1

COSH(double)

double

Hyperbolic cosine

COSH(1.2) returns 1.81065556732437

COT(double)

double

Cotangent

COT(PI/3) returns 0.577350269189626

COTH(double)

double

Hyperbolic cotangent

COTH(1.2) returns 1.19953754419235

COUNT(double, double, ...)

double

Total count of parameters passed

COUNT(1,1,2,2,3) returns 5

CSC(double)

double

Cosecant

CSC(PI/2) returns 1

CSCH(double)

double

Hyperbolic cosecant

CSCH(1.5) returns 0.469642440595225

DEG(double)

double

Converts radians to degrees

DEG(PI/2) returns 90

EXP(double)

double

E (the base of natural logarithms) raised to the specified power

EXP(2) returns 7.38905609893065

FACT(int)

int

Calculates the factorial of a non-negative integer. The factorial is the product of all positive integers less than or equal to the integer.

FACT(5) returns 120

FRAC(double)

double

Returns the fractional part of the argument.

FRAC(1.5) returns 0.5

FLOOR(double)
INT(double)

double

The greatest integer less than or equal to the specified number

FLOOR(2.5) returns 2

FORMAT(style, double)

string

Returns a formatted string expression.

FORMAT("$%1.2f", 13.4) returns $13.40

GCF(int, int)

int

Returns the greatest common factor.

GCF(9,15) returns 3

INV(double)

double

Returns the inverse of the argument. Argument must not be equal to zero.

INV(5) returns 0.2

LCD(int, int)

int

Returns the least common denominator.

LCD(6,15) returns 30

LN(double)
LOG(double)

double

Natural logarithm

LN(100) returns 4.60517018598809

LOG10(double)

double

Logarithm to base 10

LOG10(1000) returns 3

LOGB(double, double base)

double

Logarithm to base base

LOGB(1000,10) returns 3

MAX(double, double, ...)

double

Maximum

MAX(1,E,PI) returns 3.14159265358979

MEDIAN(double, double, ...)

double

Returns the median (middle) value of the arguments.

MEDIAN(2,6,4,1,3) returns 3
MEDIAN(2,6,4,1,3,7) returns 3.5

MIN(double, double, ...)

double

Minimum

MIN(1,E,PI) returns 1

MODE(double, double, ...)

double

Returns the mode (most common) value of the arguments.

MODE(2,5,3,4,5) returns 5

MODE(2,5,3,4,6) returns 0

NEG(double)

double

Negation

NEG(10) returns -10

PERM(int x, int y)

int

Returns the number of possible permutations if x objects can be placed in y positions.

PERM(5,5) returns 120

POW(double, double power)
POWER(double, double power)

double

The specified number raised to the specified power

POW(3,5) returns 243

PRIME(int x, int y)

int

Returns a random prime number in the range x to y inclusive.

PRIME(30,40) might return 31 or 37

QUARTILE(list data, int whichQuartile)

double

Returns the quartile from a list of values.

0 - Minimum/lower extreme

1 - First/lower quartile (25th percentile)

2 - Second quartile/median value (50th percentile)

3 - Third/upper quartile (75th percentile)

4 - Maximum/upper extreme

myList = LIST(33, 26, 17, 25, 31, 27, 21)

quartile(myList, 0)  returns 17, the lower extreme/minimum

quartile(myList, 1)  returns 21,  the lower quartile

quartile(myList, 2)  returns 26, the median

quartile(myList, 3)  will return 31, the upper quartile

quartile(myList, 4)  will return 33, the upper extreme/maximum

RAD(double)

double

Converts degrees to radians

RAD(180) returns 3.14159265358979

RAND(int max)

int

Random number between 1 and max.

RAND(3) might return 3

RANGE(double min, double max, double increment)

double

Returns a random number in the range min to max (inclusive). If the optional increment argument is included, the value selected will be offset from the min value by that increment. If min is less than 0 and max is greater than 0, the value 0 will never be returned by the function.

RANGE(5,10) might return 7. It will return an integer between 5 and 10.

RANGE(1,10,2) might return 5. It will return odd numbers between 1 and 10.

RANGE(2,10,2) might return 8. It will return even numbers between 2 and 10.

RANGE(1,10,.01) might return 6.41. It will return a result between 1 and 10 with 2 decimal places.

ROUND(double d, int precision)

double

Returns the number with the specified precision nearest the specified value, where d is a number to be rounded and precision is the number of significant fractional digits in the return value.

If precision is greater than or equal to 10, the function rounds the argument to the nearest precision.

ROUND(1234.5678,2) returns 1234.57

ROUND(1234.5678,10) returns 1240

ROUND(1234.5678,100) returns 1200

SDEV(double, double, ...)

double

Standard deviation

SDEV(1.5,3,7,11.5) returns 3.88104367406501

SEC(double)

double

Secant

SEC(PI/6) returns 1.15470053837925

SECH(double)

double

Hyperbolic secant

SECH(1.8) returns 0.321804869506588

SGN(double)

double

If the argument is less than zero, this function returns -1. If the argument is greater than zero, this function returns 1. Otherwise it returns zero.

SGN(-5) returns -1

SGN(5) returns 1

SGN(0) returns 0

SGNS(double)

double

If the argument is less than zero, this function returns a negative sign. Otherwise, it returns a plus sign.

SGNS(5) returns +

SGNS(-5) returns -

SIGFIG(double x, int figs, boolean force)

string

Creates a string version of the argument, x, that has figs significant digits.  If force is TRUE, then the string returned will have exactly figs significant digits (even if the function has to randomly create some digits).  If force is FALSE, then the function will return a string that has figs significant digits or less.

SIGFIG(12345,3,FALSE) returns 12300

SIGFIG(12.345,7,TRUE) returns 12.34500

SIGFIG(1230,4,TRUE) might return 1235

SIN(double)

double

The sine of the given angle (in radians).

SIN(PI/2) returns 1

SINH(double)

double

Hyperbolic sine

SINH(1.4) returns 1.90430150145153

SQR(double)
SQRT(double)

double

Square root

SQR(81) returns 9

SQR(85) returns 9.21954445729289

SUM(double, double, ...)

double

Sum of the specified numbers

SUM(1,3,5,7,9) returns 25

TAN(double)

double

Tangent

TAN(PI/6) returns 0.577350269189626

TANH(double)

double

Hyperbolic tangent

TANH(1.4) returns 0.885351648202263

VARIANCE(double, double, ...)

double

Variance

VARIANCE(1,2,5,7) returns 5.6875

 

Logical functions

Function Syntax

Return Type

Description

Usage

IF(bool condition, expression1, expression2)

any

If condition evaluates to TRUE, expression1 is returned. If condition evaluates to FALSE, expression2 is returned. This function accepts any type for its second and third parameters as long as they are both of the same type.

IF(RAND(2)=1,"HELLO","GOODBYE") returns HELLO or GOODBYE depending on the result of the RAND statement

AND(boolean, boolean, ...)

boolean

Returns true if all its arguments are true; returns false if any argument is false

AND(RAND(2)=1,RAND(2)=1) returns TRUE if both RAND statements evaluate to 1

OR(boolean, boolean, ...)

boolean

Returns true if any argument is true; returns false if all arguments are false

OR(RAND(2)=1,RAND(2)=1) returns TRUE if either RAND statement evaluates to 1

NOT(boolean)
! (boolean)

boolean

Returns true if the argument is false.

NOT(RAND(2)=1) returns TRUE if the RAND statement evaluates to 2

 

Text functions

Function Syntax

Return Type

Description

Usage

ASC(string)

int

Returns the ASCII value of the first character in the string.

ASC("R") returns 82

CHR(int)

string

Returns a string character with the ASCII value of the argument.

CHR(82) returns R

DECS(double, boolean altText)

string

Returns a decimal number as a string. If the number has an infinitely repeating decimal part, the repeating part is displayed with an overbar.

If the optional altText argument is omitted or set to true, the resulting image will be tagged with automatically-created alt text. If the optional altText argument is set to false, no alt text is included.

DECS(1/3) returns 0.3, alt text is set as "0.333..."
DECS(1/11, true) returns 0.09, alt text is set as "0.0909..."
DECS(1/7, false) returns 0.142857, no alt text

FIND(string textToFind, string textToSearch, int startIndex)

int

Returns the zero-based index of the first occurrence of a textToFind, within a textToSearch string. The search starts at a specified character position (zero-based).

FIND("n","Cognero",0) returns 3

IN(string ItemToFind, string ListItem1, string ListItem2, ...)
IN(string ItemToFind, string[ ] ListItem)

boolean

Looks for ItemToFind in the specified list of items. Returns true if item is found in the list, false otherwise.

IN("TWO","ONE","TWO","THREE") returns TRUE

IN("TWO","ONE","THREE","FIVE") returns FALSE

INSTR(string x, string y)

int

Returns the position (one-based) in the string x where the first occurrence of y was found.

INSTR("Cognero","e") returns 5

LEFT(string, int nCount)

string

Returns the first (leftmost) nCount characters from a string.

LEFT("Cognero",3) returns Cog

LEN(string)

int

Returns the number of characters in a string

LEN("Cognero") returns 7

LOWER(string)
LCASE(string)

string

Converts all uppercase letters in a text string to lowercase.

LOWER("Cognero") returns cognero

LTRIM(string)

string

Trims spaces from the left side of a string argument.

LTRIM("   Cognero") returns Cognero

MID(string, int nFirst, int nCount)

string

Returns a substring of length nCount characters from a string, starting at position nFirst (zero-based).

MID("Cognero",2,3) returns gne

RIGHT(string, int nCount)

string

Returns the last (rightmost) nCount characters from a string.

RIGHT("Cognero",3) return ero

RTRIM(string)

string

Trims spaces from the right side of a string argument.

RTRIM("Cognero   ") returns Cognero

SCIENS(double)

string

Returns a string representation of the argument in scientific notation. Choose scientific notation formatting and select the number of decimal places when formatting the variable.

SCIENS(1234567) returns 1.23 x 106 when decimal places is set to 2.

SENTENCE(string)

string

Divides a string argument into ten parts that can be used with the choose function.

MYSENTENCE: SENTENCE("one two three four five six seven eight nine ten")

CHOOSE(3,MYSENTENCE) returns three

SQRS(double radical or double coefficient, double radical or boolean altText, boolean altText)

string

Reduces the radical argument to a coefficient and a radical and returns a string representation in the root form. This function also allows for text input enclosed in quotations. This text may be formatted (e.g., italic, superscript, etc.).

If the optional altText argument is omitted or set to true, the resulting image will be tagged with automatically-created alt text. If the optional altText argument is set to false, no alt text is included.

SQRS(81) returns 9, alt text is set as "9"

SQRS(24) returns ,  alt text is set as "2 times square root of 6"

SQRS(51, true) returns alt text is set as "square root of 51"

SQRS(-5, false) returns , no alt text

SQRS(4.5, 81, true) returns 40.5, alt text is set as "40.5"

SQRS(3, 2) returns , alt text is set as "3 times square root of 2"

SQRS("x") returns , alt text is set as "square root of x"

STR(double)

string

Returns a string representation of the argument.

STR(15) returns 15

STRDUP(string, count)

string

Returns a string by repeating the string argument count number of times.

STRDUP("X",5) returns XXXXX

SUBSTITUTE(string text, string oldText, string newText)

string

Substitutes newText for oldText in a text string.

SUBSTITUTE("hello","h","j") returns jello

TRIM(string)

string

Removes all occurrences of white space characters from the beginning and end of a string.

TRIM("     Cognero     ") returns Cognero

UPPER(string)
UCASE(string)

string

Converts all lowercase letters in a text string to uppercase.

UPPER("cognero") returns COGNERO

VAL(string)

double

Returns a numeric representation of the string.

VAL("5 million") returns 5

 

Fraction functions

Function Syntax

Return Type

Description

Usage

DENOMINATOR(double)

int

Returns the denominator in the fractional part of a number.

DENOMINATOR(2.75) returns 4

FRACS(double numerator, double denominator, boolean altText)

string

Returns reduced fraction in the form "numerator/denominator" or a whole number. FRACS also allows for text fractions. This text may be formatted (e.g., italic, superscript, etc.).

If the optional altText argument is omitted or set to true, the resulting image will be tagged with automatically-created alt text. If the optional altText argument is set to false, no alt text is included.

FRACS(4,6) returns alt text is set as "2 over 3"

FRACS(10,5) returns 2, no alt text since result is not an image

FRACS("<i>x</i>", 25) returns , alt text is set as "x over 5"

FRACS(72,10, false) returns , no alt text

MIXFRACS(double numerator, double denominator, boolean altText)

string

Returns reduced fraction in the form "whole/numerator/denominator" or a whole number

If the optional altText argument is omitted or set to true, the resulting image will be tagged with automatically-created alt text. If the optional altText argument is set to false, no alt text is included.

MIXFRACS(8,6) returns , alt text is set as "1 and 1 over 3" 

MIXFRACS(8,6,false) returns , no alt text 

MIXFRACS(12,6) returns 2, no alt text since result is not an image

NUMERATOR(double)

int

Returns the numerator in the fractional part of a number.

NUMERATOR(2.75) returns 3

RFRACS(double numerator, double denominator, boolean altText)

string

Returns reduced fraction in the form "numerator/denominator"

If the optional altText argument is omitted or set to true, the resulting image will be tagged with automatically-created alt text. If the optional altText argument is set to false, no alt text is included.

RFRACS(4,6) returns ,  alt text is set as "2 over 3"

RFRACS(8,6,true) returns ,  alt text is set as "4 over 3" 

RFRACS(12,6,false) returns , no alt text 

SFRACS(double numerator, double denominator, boolean altText)

string

Returns a small, reduced fraction in the form "numerator/denominator" or a whole number. SFRACS also allows for text fractions. This text may be formatted (e.g., italic, superscript, etc.).

If the optional altText argument is omitted or set to true, the resulting image will be tagged with automatically-created alt text. If the optional altText argument is set to false, no alt text is included.

SFRACS(4,6) returns alt text is set as "2 over 3"

SFRACS(10,5) returns 2, no alt text since result is not an image

SFRACS("<i>x</i>", 25) returns , alt text is set as "x over 5"

SFRACS(72,10, false) returns , no alt text

SMIXFRACS(double numerator, double denominator, boolean altText)

string

Returns a small, reduced fraction in the form "whole/numerator/denominator" or a whole number

If the optional altText argument is omitted or set to true, the resulting image will be tagged with automatically-created alt text. If the optional altText argument is set to false, no alt text is included.

SMIXFRACS(8,6) returns , alt text is set as "1 and 1 over 3" 

SMIXFRACS(8,6,false) returns , no alt text 

SMIXFRACS(12,6) returns 2, no alt text since result is not an image

SRFRACS(double numerator, double denominator, boolean altText)

string

Returns a small, reduced fraction in the form "numerator/denominator"

If the optional altText argument is omitted or set to true, the resulting image will be tagged with automatically-created alt text. If the optional altText argument is set to false, no alt text is included.

SRFRACS(4,6) returns ,  alt text is set as "2 over 3"

SRFRACS(8,6,true) returns ,  alt text is set as "4 over 3" 

SRFRACS(12,6,false) returns , no alt text

WHOLEPART(double)

int

Returns the whole number part of a number.

WHOLEPART(2.75) returns 2

 

Other functions

Function Syntax

Return Type

Description

Usage

CHOOSE(int which, argument1, argument2, ...)

 

Selects an argument at the which location (one-based) in the list of arguments. All arguments must be of the same type (string or numeric).

CHOOSE(2,"one","two","three") returns two

EQV(double, double)

int

Returns 1 if both expressions evaluate to non-zero or if both expressions evaluate to zero, otherwise returns 0.

EQV(1,1) returns TRUE

EQV(TRUE,TRUE) returns TRUE

EQV(FALSE,FALSE) returns TRUE

EQV(FALSE,TRUE) returns FALSE

IMP(double, double)

int

Returns 1 if the first expression evaluates to non-zero and the second expression evaluates to zero, otherwise returns 0.

IMP(1,0) returns 1

IMP(TRUE,TRUE) returns 0

IMP(FALSE,FALSE) returns 0

IMP(TRUE,FALSE) returns 1

ISALPHA(string)

string

Returns TRUE If the first character of a string argument is alphabetic, otherwise returns FALSE.

ISALPHA("5 MILLION") returns FALSE

ISALPHA("FIVE MILLION") returns TRUE

ISDIGIT(string)

string

Returns TRUE If the first character of a string argument is numeric, otherwise returns FALSE.

ISDIGIT("5 MILLION") returns TRUE

ISDIGIT("FIVE MILLION") returns FALSE

ISPRIME(int)

string

Returns TRUE if the integer is prime, otherwise returns FALSE.

ISPRIME(7) returns TRUE

ISPRIME(8) returns FALSE

ISRELPRIME(int x, int y)

string

If the greatest common factor of x and y is 1, returns TRUE, otherwise returns FALSE.

ISRELPRIME(4,17) returns TRUE

ISRELPRIME(5,25) returns FALSE

ISUNIQUE(argument1, argument2, ...)

string

Returns TRUE if all arguments are unique, or FALSE if there are duplicate arguments. All of the arguments must be in the same type (string or numeric). This function is useful as a condition in evaluating multiple choice answer choices.

ISUNIQUE(1,3,5,7) returns TRUE

ISUNIQUE(1,3,5,1) returns FALSE

LIST(argument1, argument2, ...)

list

Use this function as a container to hold similar expressions (numeric or text). Then use list with other functions that have multiple arguments such as MEAN or CHOOSE.

MYLIST: LIST("dog","cat","fish","hamster")

CHOOSE(3,MYLIST) returns fish

SORT(ascending, double, double, ...)

list

Sorts a list of arguments. Arguments must be numeric. Set ascending to TRUE or FALSE.

SORT(TRUE,5,7,1,4) returns 1, 4, 5, 7

SORT(FALSE,5,7,1,4) returns 7, 5, 4, 1

SYMBOL(string x)

string

Converts the string argument, x, to the appropriate symbol character.

SYMBOL("+-") returns ±

SYMBOL("<=") returns

SYMBOL(">=") returns

SYMBOL("<>") returns

SYMBOL("X") returns ×

SYMBOL(".") returns ·

SYMBOL("/") returns ÷

SYMBOL("~=") returns

SYMBOL("congruent") returns

SYMBOL("identical") returns

SYMBOL("intersection") returns

SYMBOL("union") returns

SYMBOL("subset") returns

SYMBOL("superset") returns

SYMBOL("left") returns

SYMBOL("right") returns

SYMBOL("up") returns

SYMBOL("down") returns

SYMBOL("leftright") returns

SYMBOL("leftdouble") returns

SYMBOL("rightdouble") returns

SYMBOL("leftrightdouble") returns

SYMBOL("equilibrium") returns

SYMBOL("alpha") returns α

SYMBOL("ALPHA") returns Α

SYMBOL("beta") returns β

SYMBOL("BETA") returns Β

SYMBOL("gamma") returns γ

SYMBOL("GAMMA") returns Γ

SYMBOL("delta") returns δ

SYMBOL("DELTA") returns Δ

SYMBOL("epsilon") returns ε

SYMBOL("EPSILON") returns Ε

SYMBOL("zeta") returns ζ

SYMBOL("ZETA") returns Ζ

SYMBOL("eta") returns η

SYMBOL("ETA") returns Η

SYMBOL("theta") returns θ

SYMBOL("THETA") returns Θ

SYMBOL("iota") returns ι

SYMBOL("IOTA") returns Ι

SYMBOL("kappa") returns κ

SYMBOL("KAPPA") returns Κ

SYMBOL("lambda") returns λ

SYMBOL("LAMBDA") returns Λ

SYMBOL("mu") returns μ

SYMBOL("MU") returns Μ

SYMBOL("nu") returns ν

SYMBOL("NU") returns Ν

SYMBOL("xi") returns ξ

SYMBOL("XI") returns Ξ

SYMBOL("omicron") returns ο

SYMBOL("OMICRON") returns Ο

SYMBOL("pi") returns π

SYMBOL("PI") returns Π

SYMBOL("rho") returns ρ

SYMBOL("RHO") returns Ρ

SYMBOL("sigma") returns σ

SYMBOL("SIGMA") returns Σ

SYMBOL("tau") returns τ

SYMBOL("TAU") returns Τ

SYMBOL("upsilon") returns υ

SYMBOL("UPSILON") returns Υ

SYMBOL("phi") returns φ

SYMBOL("PHI") returns Φ

SYMBOL("chi") returns χ

SYMBOL("CHI") returns Χ

SYMBOL("psi") returns ψ

SYMBOL("PSI") returns Ψ

SYMBOL("omega") returns ω

SYMBOL("OMEGA") returns Ω

Greek Characters
To insert a Greek character enter the name of the character in quotes. Enter the name with an initial cap or all caps to display a capital letter or all lower case to display a lower case Greek letter.

SYMBOL("ALPHA") returns A

SYMBOL("alpha") returns a

UNSORT(double, double, ...)

list

Scrambles a list of arguments.

UNSORT(1,4,5,7) might return 4, 1, 7, 5

 

Operators

Operator

Input Type

Description

Usage

+

number, string

addition

6 + 4 returns 10

"fence" + "post" returns fencepost

-

number

subtraction

7 - 4 returns 3

*

number

multiplication

5 * 6 returns 30

/

number

division

24 / 4 returns 6

%

number

remainder (modulus)

25 % 7 returns 4

^

number

power

3 ^ 4 returns 81

<

number, string

less than

IF(3<4,TRUE,FALSE) returns TRUE

>

number, string

greater than

IF(3>4,TRUE,FALSE) returns FALSE

<=

number, string

less than or equal

IF(7<=7,TRUE,FALSE) returns TRUE

>=

number, string

greater than or equal

IF(7>=9,TRUE,FALSE) returns TRUE

=
==

number, string

equality

IF(4=4,TRUE,FALSE) returns TRUE

!=
<>

number, string

inequality

IF(4!=4,TRUE,FALSE) returns FALSE

AND
&&

boolean

logical AND

IF(3=3 AND 4=5,TRUE,FALSE) returns FALSE

OR
||

boolean

logical OR

IF(3=3 OR 4=5,TRUE,FALSE) returns TRUE

XOR

boolean

logical exclusive OR

IF(3=3 XOR 4=5,TRUE,FALSE) returns TRUE

IF(3=3 XOR 5=5,TRUE,FALSE) returns FALSE