A float is no twin of a number that a declaration spells #651
Loading…
Reference in a new issue
No description provided.
Delete branch "rpg-9-aq-twin-spelling-20261028"
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 is no twin of a number that a declaration spells
The evaluator writes a float constant as the decimal literal it twins when the
pool holds an unnamed decimal of the same value. The pool also holds the numbers
that the declarations spell:
char(10)pools an unnamed10, and the compilershares no constant between a declaration and the twin of a float, so
char(10)beside
1.0pools two10(ftwin14-x2). With only one10in the pool thedeclaration owns it. The evaluator took it for the twin of a float
1.0, wrote1.0, and the rebuilt object pooled a second10.The held-out exam showed it: the rebuilt object had one decimal of two digits
more than the reference, and with it the creation data of the initialization
and the imports. A decimal that a field of the source spells (the length of a
character field, the digits of a packed, zoned or binary field) and that no
other unnamed decimal has is no twin.
A float without a twin is written as an integer (
F * 1) when its value isintegral: that pools one float and no decimal (
ftwin14-x1,ftwin14-x3). Aliteral with an exponent pools two floats of its value, so a second float of
the value makes it
1E0(ftwin14-x5) and a bare integer twin is no proofbeside it. A decimal literal keeps its twin (
ftwin14-x2,ftwin14-x4).Gates