DIVIDE Examples


Example 1:

 

  

DIVIDE

SENDING INTO RECV(X)

 

 

Variable

Format

Contents

Before:

SENDING

2.2

•1.10

 

RECV(X)

5.2

•••25.00

 

After:

SENDING

2.2

•1.10

 

RECV(X)

5.2

•••22.73

 

No Condition Flag is set. The quotient was rounded from 22.727.

Example 2:

 

Variable

Format

Contents

Before:

SENDING

1.2

•.00

 

RECV(X)

3.2

125.50

 

After:

SENDING

1.2

•.00

 

RECV(X)

3.2

•••.00

 

The OVER Condition Flag is set since SENDING equaled zero. The LESS and ZERO Condition Flags are unpredictable.

Example 3:

  

DIVIDE

SENDING INTO RECV(X) GIVING OPTDEST

 

 

Variable

Format

Contents

Before:

SENDING

2.2

•1.10

 

RECV(X)

5.2

•••25.00

 

OPTDEST

5.2

•••••.00

 

After:

SENDING

2.2

•1.10

 

RECV(X)

5.2

•••25.00

 

PTDEST

5.2

•••22.73

 

No Condition Flag is set. The quotient was rounded from 22.727.

 

Example 4:

 

ARRAY1

FORM

3(10)

ARRAY2

FORM

3(10)

ARRAY3

FORM

4(10)

  

...

 

  

DIVIDE

ARRAY1,ARRAY2,ARRAY3

 

Performs a standard 3 operand DIVIDE instruction on each element within each array.

 

Example 5:

 

WHOLE

FORM

5.2

NET

FORM

3.2

  

...

 

  

DIVIDE

"100",WHOLE,NET

 

 

Variable

Format

Contents

Before:

WHOLE

5.2

15723.10

 

NET

3.2

•••.00

 

After:

WHOLE

5.2

15723.10

 

NET

3.2

••7.23

 

Performs a standard three operand DIVIDE instruction. Note that WHOLE was truncated to 723.10 when it was moved to NET prior to the DIVIDE being performed.

 



PL/B Language Reference DISABLEITEM Example DMAKE Example