Exact versus inexact decimal floating-point numbers and computation system
AssigneeKing Fahd University of Petroleum and Minerals
InventorMuhamed F. Mudawar
Life of this patent
Estimating the term…
Abstract
This disclosure represents an improved computer system and process to avoid the consequences of improper conversion of numbers and of rounding errors. This process makes the distinction between exact and inexact decimal floating-point numbers. If the result of a sequence of operation is exact, the user can trust that every decimal digit in the computed result is correct. On the other hand, if the input operands are inexact or the result cannot be computed exactly, a loss of significant digits occurs, and the user is warned of the loss. A novel representation is used for the inexact computed values. An estimate of the absolute error is also part of the representation.
Claims20
A computerized method for performing computations, the method comprising:
- receiving, at one or more processors, a first operand in a data format, wherein the first operand is a first decimal number;
- receiving, at the one or more processors, a second operand in the data format, wherein the second operand is a second decimal number, wherein the second operand includes four fields:
- a sign bit, a 5-bit leading digit field, a biased exponent field, and a trailing coefficient field, wherein the leading digit field specifies whether the second decimal number is exact, an inexact decimal number with a trailing low fraction, or an inexact decimal number with a trailing high fraction;
- and
- performing, at the one or more processors, a computation operation comprising digit injection, in which a result of the computation operation encodes a leading digit field according to the coefficient field, exactness of a fraction field, and whether the result is overflow or not a number, wherein the trailing low fraction or the trailing high fraction of the result are replaced by decimal values, respectively, with an injected Binary-Coded Decimal fraction digit.
A system for performing computations, the system comprising:
- one or more processors and a non-transitory computer readable storage having software instructions stored thereon configured to cause the one or more processors to:
- receive a first operand in a data format, wherein the first operand is a first decimal number;
- receive a second operand in the data format, wherein the second operand is a second decimal number, wherein the second operand includes four fields:
- a sign bit, a 5-bit leading digit field, a biased exponent field, and a trailing coefficient field, wherein the leading digit field specifies whether the second decimal number is exact, an inexact decimal number with a trailing low fraction, or an inexact decimal number with a trailing high fraction;
- and
- perform a computation operation comprising digit injection, in which a result of the computation operation encodes a leading digit field according to the coefficient field, exactness of a fraction field, and whether the result is overflow or not a number, wherein the trailing low fraction or the trailing high fraction of the result are replaced by decimal values, respectively, with an injected Binary-Coded Decimal fraction digit.
A non-transitory computer readable medium having instructions stored therein that, when executed by one or more processors, cause the one or more processors to perform a method for performing computations, the method comprising:
- receiving, at one or more processors, a first operand in a data format, wherein the first operand is a first decimal number;
- receiving, at the one or more processors, a second operand in the data format, wherein the second operand is a second decimal number, wherein the second operand includes four fields:
- a sign bit, a 5-bit leading digit field, a biased exponent field, and a trailing coefficient field, wherein the leading digit field specifies whether the second decimal number is exact, an inexact decimal number with a trailing low fraction, or an inexact decimal number with a trailing high fraction;
- and
- performing, at the one or more processors, a computation operation comprising digit injection, in which a result of the computation operation encodes a leading digit field according to the coefficient field, exactness of a fraction field, and whether the result is overflow or not a number, wherein the trailing low fraction or the trailing high fraction of the result are replaced by decimal values, respectively, with an injected Binary-Coded Decimal fraction digit.
Dependencies are inferred from the claim text.