A float value stored into a packed field #641
Loading…
Reference in a new issue
No description provided.
Delete branch "rpg-9-af-float-packed-20261026"
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 float value stored into a packed field
An assignment of a float expression to a packed field (
total = rate + scale,rateandscalefloat(8),total packed(9:2)) compiles to thefloat operation, then a conversion to the digits and the decimal positions of
the field inside a change of the floating-point rounding mode: the program
reads the mode (builtin 145), sets the mode 64 when it is another one
(builtin 146), converts (
90 D P 0), and sets the kept mode again. No ruleknew the builtins, so the statement stayed unresolved.
The new value unit (
rpg_float_decimal.zig) proves the whole sequence: theconstants 1 and 64, the two builtins, a temporary and two labels that only
the unit uses, and a store into a packed field of D digits right after it.
The unit keeps the float value on the stack, and the store is the
conversion of the source. Another mode, another builtin or a field of other
digits stays unresolved.
r6a-float-inzis the public reproduction; itsemit is complete.
Gates
dd5aa4d34f23e314530f