CPC G06F 7/49957 (2013.01) [G06F 7/386 (2013.01); G06F 7/483 (2013.01); G06F 7/491 (2013.01); G06F 7/49915 (2013.01); G06F 7/49963 (2013.01); G06F 7/49968 (2013.01); G06F 7/49973 (2013.01); G06F 7/49978 (2013.01); G06F 7/49984 (2013.01); G06F 9/30014 (2013.01); G06F 17/10 (2013.01); H05K 999/00 (2013.01); H05K 999/99 (2013.01); G06F 7/49947 (2013.01)] | 25 Claims |
1. A computer implemented method for indicating with any least significant decimal coefficient digit of 0 or 5 that a result of a rounding of a decimal floating-point (DFP) number to a lesser precision in a computer processor is an exact (precise) result, the method comprising:
fetching a DFP round-for-reround instruction in a machine, the machine implementing a plurality of floating point registers and including the computer processor:
executing, by the computer processor, the DFP round-for-reround instruction in a round-for-reround mode, wherein the DFP round-for-reround instruction is configured to perform a DFP operation on a DFP operand, the executing the DFP round-for-reround instruction comprising:
based on being in the round-for-reround mode, forming, by the computer processor, from a decimal coefficient number having a high order portion and a low order portion, an intermediate result from the high order portion, wherein the intermediate result has a least significant decimal coefficient digit;
without changing any coefficient digit of the intermediate result, other than the least significant decimal coefficient digit, creating from the intermediate result a rounded-for-reround DFP number, the creating comprising:
based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having any value other than 0, incrementing the least significant coefficient digit of the intermediate result; and
storing in computer processor storage, by the computer processor, the intermediate result as a final result of the executed DFP operation, wherein the intermediate result is the rounded-for-reround DFP number, wherein a final result having a least significant digit of 0 or 5 indicates that the final result is exact and that the low order portion is 0, wherein a final result having a least significant digit of any one of 1, 2, 3, 4, 6, 7, 8 and 9 does not indicate that the final result is exact and does not indicate that the low order portion is 0.
|