A %DEC divisor takes the decimal positions that the edit mask proves #656
Loading…
Reference in a new issue
No description provided.
Delete branch "rpg-9-au-dec-divisor-scale-20261029"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A %DEC divisor takes the decimal positions that the edit mask proves
%DEC(I / c : D : P)of an integer I compiles to86; 27 c; 5; 61 (10+P+s) (P+s) 0; 5; 56 D 0 0, where s is the decimal positions of the literal c. Thepool keys c by its digits only, so
%dec(I / 1000 : 11 : 3),%dec(I / 100.0 : 11 : 2)and%dec(I / 10.00 : 11 : 1)compile to the sameoperations and operands (ftwin18-d1, -d2, -d3). The evaluator wrote all three as
%DEC(I / 1000: 11: 3): the operations matched, but the value had otherdecimal positions, and so did the edit mask of a
%EDITCaround it.The edit mask proves the positions of the value (
b3 4b 03then oneaaperdecimal,
rpg_editc.maskDecimals). The%EDITCunit now carries them as anoperand, and the evaluator rewrites each
%DECdivision of an integer dividendby one decimal literal for that value: P from the mask, s the shift less P
(
rpg_eval.decDivisionsAt). Without an edit around it the text stays as before.Retained as evidence of the cases still open: ftwin18-d6 (a packed dividend
with decimal positions of its own: the shift is P + s - a) and ftwin18-d7 (the
store into a
packed(11:2)field proves P = 2 without a mask).Gates