摘要 |
A processor representation of a floating-point data item is converted to a representation of a truncated integer item, without changing the rounding mode of a processor. When the current rounding mode is unknown, the floating-point item is converted to an integer representation in whatever mode the processor happens to be in. One of multiple correction values is applied, in response to the sign of the original data, a difference between the integer and the original data, and whether the item is an integer. When the current rounding mode is known, the processor produces two integer representations, and selects one or the other of them as an output integer data item, in response to the sign of the original item and the relative sizes of the two representations.
|