MULTIPLY Examples


Example 1:

 

  

MULTIPLY

SENDING BY RECVING

 

 

Variable

Format

Contents

Before:

SENDING

3.1

•20.3

 

RECVING

3.1

•44.5

 

After:

SENDING

3.1

•20.3

 

RECVING

3.1

903.4

 

No Condition Flag is set. The product was rounded from 903.35

 

Example 2:

 

 

Variable

Format

Contents

Before:

SENDING

3

•30

 

RECVING

4.1

•710.2

 

After:

SENDING

3

•30

 

RECVING

4.1

1306.0

 

The OVER Condition Flag is set. RECVING was too small to contain 21306.0. The LESS and ZERO Condition Flags are unpredictable.

 

Example 3:

 

  

MULTIPLY

"1.05" BY RECVING

 

 

Variable

Format

Contents

Before:

RECVING

3.2

••25.25

 

After:

RECVING

3.2

••26.51

 

No Condition Flag is set. RECVING was truncated from 26.5125.

 

Example 4:

 

  

MULTIPLY

SENDING BY RECVING,OPTDEST

 

 

Variable

Format

Contents

Before:

SENDING

3.1

•20.3

 

RECVING

3.1

•44.5

 

OPTDEST

3.1

•••.0

 

After:

SENDING

3.1

•20.3

 

RECVING

3.1

•44.5

 

OPTDEST

3.1

903.4

 

No Condition Flag is set. The product was rounded from 903.35.

 

Example 5:

 

ARRAY1

FORM

3(10)

X

FORM

5

 

...

 

 

MULTIPLY

X,ARRAY1

 

Multiplies the value in each array element of ARRAY1 by the current value in X placing the result in each individual array element.

 

 



PL/B Language Reference MOVEPTR Examples MUNDEF Example