Bernal Javier, Witzgall Christoph
National Institute of Standards and Technology, Gaithersburg, MD 20899, USA.
J Res Natl Inst Stand Technol. 2006 Apr 1;111(2):79-88. doi: 10.6028/jres.111.006. Print 2006 Mar-Apr.
A scheme is presented and software is documented for representing as integers input decimal numbers that have been stored in a computer as double precision floating point numbers and for carrying out multiplications, additions and subtractions based on these numbers in an exact manner. The input decimal numbers must not have more than nine digits to the left of the decimal point. The decimal fractions of their floating point representations are all first rounded off at a prespecified location, a location no more than nine digits away from the decimal point. The number of digits to the left of the decimal point for each input number besides not being allowed to exceed nine must then be such that the total number of digits from the leftmost digit of the number to the location where round-off is to occur does not exceed fourteen.
本文提出了一种方案并记录了相关软件,用于将以双精度浮点数形式存储在计算机中的输入十进制数表示为整数,并基于这些数精确地进行乘法、加法和减法运算。输入的十进制数在小数点左边的位数不得超过九位。其浮点表示形式的小数部分都先在预先指定的位置进行舍入,该位置距离小数点不超过九位。每个输入数在小数点左边的位数除了不得超过九位外,还必须使得从该数最左边的数字到舍入位置的总位数不超过十四位。