Turning Technologies ExamView User Manual

Page 116

Advertising
background image

ExamView Test Generator

116

Syntax

Description

string fracs(double

numer, double denom)

After reducing the fraction numer / denom, this function will return a string as either a whole number, or a fraction in the form
"numer/denom". When displayed, this function will draw a stacked fraction if necessary. If denom is 0, the function will return "0".

EXAMPLE

fracs(22, 6)

will return

fracs(22, 11)

will return 2

int gcf(int x, int y)

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

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).

expression IMP

expression

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

INF

[Constant] ∞. Can be used to represent positive or negative infinity (INF).

int instr(string x,

string y)

Searches in the string, x, for the sub-string, y. If it finds it, the function will return the position in the string, x, where the first
occurrence of y was found (between 1 and the length of string, x). If the substring is not found, the function returns FALSE (0).

int int(double x)

Returns the integer portion of the argument, x. If x is positive, it rounds down. If x is negative, it rounds up.

double inv(double x)

Returns the inverse of the argument, x. Actual function is 1 / x. Arguments to the function must not be equal to zero.

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).

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).

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.

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