Turning Technologies ExamView User Manual

Page 107

Advertising
background image

ExamView Test Generator

107

decs*

string decs(double x)

This function returns a string representation of the decimal number. If the function
determines that the number, x, has an infinitely repeating decimal part, the repeating part
will be displayed with an overbar.

EXAMPLE

decs(18.333333333333)

will return

decs(0.0142857142857)

will return

decs(4.25)

will return

format

string format(string format, double x)

Writes formatted output to a string. For a complete description of formatting specifiers,
look in any C programming manual.

EXAMPLE

format("$%1.2f", 13.4)

will return "$13.40"

format("%d feet", 17)

will return "17 feet"

gcf

int gcf(int x, int y)

Returns the greatest common factor of the arguments, x and y.

if

expression if (int condition, expression arg1, expression arg2)

Use to implement a conditional expression. If condition evaluates to non-zero, arg1 will
be returned, else arg2 will be returned. Both of the arguments must be of the same type
(string or numeric).

isalpha

int isalpha(string x)

If the first character of the string argument, x, is in the range "A" to "Z" or "a" to "z", the
function will return TRUE (1), otherwise it will return FALSE (0).

isdigit

int isdigit(string x)

If the first character of the string argument, x, is in the range "0" to "9", the function will
return TRUE (1), otherwise it will return FALSE (0).

isprime

int isprime(int x)

Evaluates the number to see if it is prime. If the number is prime, the function will return
TRUE (1), otherwise it returns FALSE (0). NOTE: Values must be in the range 2 to
1,000,000.

isrelprime

int isrelprime(int x, int y)

Evaluates the two numbers to see if they are relatively prime. If the greatest common
factor of x and y is 1, the function will return TRUE (1), otherwise it returns FALSE (0).

turningtechnologies.com/user-guides

Advertising