2-4-12

Function Calculations

ICondition Judgment (judge, piecewise)S“judge” Function

The “judge” function returns TRUE when an expression is true, and FALSE when it is false.

Problem

 

Use this keyboard:

 

Operation

 

 

 

 

 

 

mth

abc

cat

2D

 

 

 

 

 

 

 

 

 

Is the following expression

 

 

Func

 

[judge] 1 1 U

true or false?

 

 

 

 

 

 

1 = 1

TRUE

 

 

 

 

 

 

 

 

 

 

 

Is the following expression

 

 

Func

 

[judge] 1 0 U

true or false?

 

 

 

 

 

 

1 < 0

FALSE

 

 

 

 

 

 

 

 

 

 

 

 

S“piecewise” Function

The “piecewise” function returns one value when an expression is true, and another value when the expression is false.

The syntax of the “piecewise” function is shown below.

piecewise(<condition expression>, <return value when true>, <return value when false or indeterminate> [ ) ]

or

piecewise(<condition expression>, <return value when true>, <return value when false>, <return value when indeterminate> [ ) ]

Use the 2D keyboard ( ) to input “piecewise” function according to the syntax shown

below.

<return value when true>, <condition expression> <return value when false or indeterminate>

or

<return value when condition 1 is true>, <condition 1 expression> <return value when condition 2 is true>, <condition 2 expression>

Problem

Use this keyboard:

 

 

Operation

 

 

 

 

 

mth

abc

cat

2D

 

 

 

 

 

 

 

 

 

 

For the expression 0 x

 

 

Func

 

[piecewise] 0  7 1

(x = variable), return 1 when

 

 

 

 

2 U

 

x is 0 or less, and 2 when x

 

 

 

 

or

 

is greater than 0 or

 

 

 

 

1 A 2 CD 0  7

undefined.

 

 

 

 

U

 

 

 

 

 

 

 

 

 

 

 

 

 

For the expression 1 x

 

 

 

 

1 A 2 CD 1  7

(x = variable), return 1 when

 

 

 

 

A 1

7U

x is 1 or less, and 2 when x

 

 

 

 

 

 

is greater than 1.

 

 

 

 

 

 

 

 

 

 

 

 

 

20090601