## compute with floating-point

## compute with floating-point

(OP)

Hello,

the COMPUTE example below with a floating-point is much faster(about 1:4) than without one. Can somebody explain it ? It´s depending on which compiler there are used ?

COMPUTE decimal = amount * (10 ** (dcml * -1)) + 0.0E+00)

decimal PIC S9(12)V(6) COMP-3.

amount PIC S9(18) COMP-3.

dcml PIC 9(04).

Regards

cbmstr

the COMPUTE example below with a floating-point is much faster(about 1:4) than without one. Can somebody explain it ? It´s depending on which compiler there are used ?

COMPUTE decimal = amount * (10 ** (dcml * -1)) + 0.0E+00)

decimal PIC S9(12)V(6) COMP-3.

amount PIC S9(18) COMP-3.

dcml PIC 9(04).

Regards

cbmstr

## RE: compute with floating-point

## RE: compute with floating-point

## RE: compute with floating-point

resolves the problem with no calculationsPerhaps an EVALUATE to choose the proper redefined variable ?

## RE: compute with floating-point

## RE: compute with floating-point

That same decimal arithmetic package might also similarly recognize a multiplication where the multiplier or multiplicand, or a division where the divisor, normalizes to a power of 10 and adjust the scale of the intermediate result.

But that all depends on how you measure efficiency. Will the OP ever recover the computational time spent researching this and posing the question?

Tom Morrison

## RE: compute with floating-point

## RE: compute with floating-point

No, but it sure explains the vast proliferation of it!

Code what you mean,

and mean what you code!

But by all means post your code!

Razalas