摘要 |
<P>PROBLEM TO BE SOLVED: To provide a technology for making it possible to obtain a result of rounding in accordance with a specified rounding mode, independently of hardware architecture. <P>SOLUTION: A second accuracy radix conversion part 11 applies radix conversion to a value to be converted, with second accuracy higher than specified first accuracy. A first accuracy radix conversion part 13 rounds a result of the radix conversion with the second accuracy, with the specified first accuracy. A difference calculation part 15 calculates a difference in the results between the rounding with the first accuracy and the radix conversion with the second accuracy. A rounding direction determination part 17 determines whether or not a direction of rounding in the result of rounding with the first accuracy is equal to a direction of rounding in accordance with a specified rounding mode, based on a mark of the difference. A rounding result correction part 18, when the direction of rounding in the result of rounding with the first accuracy is not equal to the direction of rounding in accordance with the specified rounding mode, corrects the result of rounding with the first accuracy, based on a relationship between the mark of the difference and a mark of the result of rounding with the first accuracy. <P>COPYRIGHT: (C)2013,JPO&INPIT |