Documentation/Calc Functions/RAWSUBTRACT/en

Function name:
RAWSUBTRACT

Category:
Mathematical

Summary:
Subtracts numbers without eliminating small roundoff errors.

Syntax:
RAWSUBTRACT(Minuend; Subtrahend 1[; Subtrahend 2[; … ;[ Subtrahend 254]]])

Returns:
Returns a real number that is the result of subtracting the various subtrahend arguments from the minuend, without eliminating roundoff errors.

Arguments:
Minuend is a real number, or a reference to a cell containing a real number, from which other numbers are to be subtracted.

Subtrahend 1, Subtrahend 2, …, Subtrahend 254 give the set of real numbers that are to be subtracted from Minuend. Each argument may be a real number, an expression that evaluates to a real number, or a reference to a single cell containing a real number.


 * If any argument is a string in quotation marks, then RAWSUBTRACT reports a #VALUE! error.
 * If any argument is a reference to a cell that contains non-numeric data, then RAWSUBTRACT reports a #VALUE! error.
 * If any argument is a reference to a cell that is empty, then RAWSUBTRACT treats it as containing 0.

Additional details:

 * Consider the simple Calc formula  which evaluates to 0. Most people would intuitively expect this formula to return 0. However, behind the scenes, things aren’t so clear-cut because not every decimal number can be exactly represented as a binary floating-point number. This means that small roundoff errors can creep into the calculations but, to meet the needs of most users, the subtraction operator eliminates any such errors that arise.


 * RAWSUBTRACT uses the IEEE Standard for Floating-Point Arithmetic (IEEE 754) subtraction operation that the platform/compiler provides. The formula   does not return 0 but instead returns the value -2.77555756156289E-17. This demonstrates that a small roundoff error has arisen that would be of no significance to many users. However, for some applications visibility of this error could be useful, for example, when determining whether two values are identical.


 * RAWSUBTRACT can be used to compare whether a result exactly matches an expected number, that is, if  is equal to 0.0.


 * RAWSUBTRACT processes arguments from left to right. For example,  calculates 1-2-3-4 or ((1-2)-3)-4 in "natural" order.

Related LibreOffice functions:
None.

ODF standard:
None.

Equivalent Excel functions:
None.