A %DEC divisor takes the decimal positions that the edit mask proves #656

Manually merged
binjovi-bot merged 1 commit from rpg-9-au-dec-divisor-scale-20261029 into trunk 2026-10-29 02:34:17 +00:00
Owner

A %DEC divisor takes the decimal positions that the edit mask proves

%DEC(I / c : D : P) of an integer I compiles to 86; 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. The
pool 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 same
operations and operands (ftwin18-d1, -d2, -d3). The evaluator wrote all three as
%DEC(I / 1000: 11: 3): the operations matched, but the value had other
decimal positions, and so did the edit mask of a %EDITC around it.

The edit mask proves the positions of the value (b3 4b 03 then one aa per
decimal, rpg_editc.maskDecimals). The %EDITC unit now carries them as an
operand, and the evaluator rewrites each %DEC division of an integer dividend
by 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

{"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden 173/5/0 == dump 173/5/0","emit":{"worse":[],"better":45,"newly_clean":45,"clean_delta":45,"base":215,"new":260},"twins":{"groups":455,"recovered":447,"regressions":[],"newly":32},"allgroups":{"regressions":[],"newly":["rpg-corpus-captures/files-chain/stripped/object.savf 2","rpg-corpus-captures/files-display-write/stripped/object.savf 2","rpg-corpus-captures/files-logical/stripped/object.savf 2","savf/SC-CONSTRUCT/POINTER/rpg-pointer-procedure-auto/stripped/archive.savf 1","savf/SC-ILE/DSPLY/error-observable/archive.savf 2","savf/SC-ILE/DSPLY/error-stripped/archive.savf 2","savf/SC-ILE/DSPLY/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/d4-edit/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-const/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-input/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-srcstmt-dspf/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7-args/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7c-copy/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/decimal-fault-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/decimal-sign-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j1/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j2/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j3/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/format-base/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/format-rename/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/gotos-static/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/h-editc/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc5/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc6/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-fmix/stripped/object.savf 11","savf/SC-ILE/EXPERIMENTS/h-subind/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/packed-add-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/packed-compose-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/packed-compose-sign-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/program-literal/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5b-onexit-for/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/r5e-date-field/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5e-editc-held/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5i-figurative/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-float-inz/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-reset-ds/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-fixed/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-two/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-full/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-none/stripped/archive.savf 2","savf/SC-ILE/MONITOR/limits-observable/archive.savf 1","savf/SC-ILE/MONITOR/limits-stripped/archive.savf 1","savf/SC-ILE/MONITOR/stripped/archive.savf 2","savf/SC-ILE/TSTRIP-STRIPPED/archive.savf 2","savf/SC-ILE/TSTRIP/archive.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":1413}}
# A %DEC divisor takes the decimal positions that the edit mask proves `%DEC(I / c : D : P)` of an integer I compiles to `86; 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. The pool 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 same operations and operands (ftwin18-d1, -d2, -d3). The evaluator wrote all three as `%DEC(I / 1000: 11: 3)`: the operations matched, but the value had other decimal positions, and so did the edit mask of a `%EDITC` around it. The edit mask proves the positions of the value (`b3 4b 03` then one `aa` per decimal, `rpg_editc.maskDecimals`). The `%EDITC` unit now carries them as an operand, and the evaluator rewrites each `%DEC` division of an integer dividend by 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 ``` {"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden 173/5/0 == dump 173/5/0","emit":{"worse":[],"better":45,"newly_clean":45,"clean_delta":45,"base":215,"new":260},"twins":{"groups":455,"recovered":447,"regressions":[],"newly":32},"allgroups":{"regressions":[],"newly":["rpg-corpus-captures/files-chain/stripped/object.savf 2","rpg-corpus-captures/files-display-write/stripped/object.savf 2","rpg-corpus-captures/files-logical/stripped/object.savf 2","savf/SC-CONSTRUCT/POINTER/rpg-pointer-procedure-auto/stripped/archive.savf 1","savf/SC-ILE/DSPLY/error-observable/archive.savf 2","savf/SC-ILE/DSPLY/error-stripped/archive.savf 2","savf/SC-ILE/DSPLY/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/d4-edit/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-const/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-input/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-srcstmt-dspf/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7-args/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7c-copy/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/decimal-fault-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/decimal-sign-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j1/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j2/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j3/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/format-base/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/format-rename/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/gotos-static/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/h-editc/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc5/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc6/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-fmix/stripped/object.savf 11","savf/SC-ILE/EXPERIMENTS/h-subind/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/packed-add-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/packed-compose-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/packed-compose-sign-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/program-literal/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5b-onexit-for/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/r5e-date-field/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5e-editc-held/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5i-figurative/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-float-inz/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-reset-ds/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-fixed/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-two/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-full/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-none/stripped/archive.savf 2","savf/SC-ILE/MONITOR/limits-observable/archive.savf 1","savf/SC-ILE/MONITOR/limits-stripped/archive.savf 1","savf/SC-ILE/MONITOR/stripped/archive.savf 2","savf/SC-ILE/TSTRIP-STRIPPED/archive.savf 2","savf/SC-ILE/TSTRIP/archive.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":1413}} ```
A %DEC divisor takes the decimal positions that the edit mask proves
All checks were successful
binjovi/ci Binjovi completed the frozen plan
af51855a6a
%DEC(I / c : D : P) of an integer I rescales the dividend by P plus the
positions s of c, and the pool keys c by its digits only, so 1000 with P 3,
100.0 with P 2 and 10.00 with P 1 compile to the same operations. The edit
mask of a %EDITC around the division proves P; the %EDITC unit now carries
it and the evaluator writes the divisor at the shift less P (ftwin18).
binjovi-bot manually merged commit b4a9af3f85 into trunk 2026-10-29 02:34:17 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!656
No description provided.