Thanks Peter!
That's the issue I don't quite understand - why would the intermediate precision be any different than the normal
conversion dictates?
I think, for example, if you consider the precision results when RULES(IBM) is applied, the results are directly
derived from the substitution of the converted precision - which would be following the standard (the operands
are converted to the common derived type and then the operation is performed.) I went thru the steps, and
neglecting the problem of producing an intermediate value larger than M the formulas seem to directly precede from
that rule.
So, why would that not be the case for RULES(ANS) ?
For example, consider the situation of FIXED DEC(p1,q1) / FIXED BIN(p2,q2) under RULES(IBM), if you
apply the conversion of the FIXED DEC(p1,q1) to a FIXED BIN, you'll get a FIXED BIN with the
precision of ( min(M, 1+CEIL(p1*3.32)), CEIL(ABS(q1*3.32)*SIGN(q1) ) ). If you then substitute that
into the formula for FIXED BIN / FIXED BIN (neglecting the min()) you have p = M,
q = M - (1+CEIL(p1*3.32)) + CEIL(ABS(q1*3.32)*SIGN(q2)) - q2; which matches the documented
precision results for FIXED DEC / FIXED BIN (under RULES(IBM))
The same works for FIXED BIN(p1,q1) / FIXED DEC(p2,q2).
I was just assuming since that approach is taken for RULES(IBM) - a similar approach would
be had for RULES(ANS) ? It seems like it's not... so, is there some reason? If that approach
isn't taken, wouldn't there be a risk of loosing precision?
- Thanks
- Dave R. -
tdr