Documentation/Calc Functions/REST
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
REST
Kategori:
Matematisk
Resume:
Denne funktion returnerer dividende modulo divisor, der er resten, når dividenden er divideret med divisoren.
Often the dividend and divisor will be integer values (Euclidean division). However, REST accepts and processes real numbers with non-zero fractional parts.
Syntaks:
REST(Dividend; Divisor)
Returnerer:
Returnerer et realt tal, der er resten, når det ene tal er divideret med det andet.
Argumenter:
Dividende er et reelt tal eller en reference til cellen, der indeholder det tal, der bliver dividenden i funktionen MOD. Divisor er et reelt tal eller en reference til cellen, der indeholder det tal
Divisor is a real number, or a reference to a cell containing that number, that is the divisor of the divide operation.
- Hvis divisoren er 0, så returnerer funktionen en fejlværdi.
- If Divisor is equal to 0, then REST reports a #DIV/0! error.
Yderligere oplysninger:
- * Denne funktion er implementeret som Dividende - Divisor * HELTAL(Dividende/Divisor) og den giver et resultat, selv om argumenterne ikke er heltal.
- Resultatets fortagn er det samme som Divisorens.
[math]\displaystyle{ \text{ REST}(x,y)~=~x-\left(y\times \text{ HELTAL} \left(\frac{x}{y}\right)\right) }[/math]
- The HELTAL function always rounds down (toward -∞) and returns the largest integer less than or equal to a given number. This means that when the dividend and divisor have different signs, REST may produce results that appear counterintuitive. For example, the formula
=REST(7; −3)
returns −2; this is because the fraction [math]\displaystyle{ \left(\frac{7}{-3}\right) }[/math] is rounded to −3 by the HELTAL function.
- For more general information about the modulo operation, visit Wikipedia’s Modulo operation page.
Eksempler:
Formel | Beskrivelse | Returnerer |
---|---|---|
=REST(11; 3) | Return the remainder when 11 is divided by 3. The result has the same (positive) sign as the divisor. | 2 |
=REST(−11; 3) | Return the remainder when −11 is divided by 3. The result has the same (positive) sign as the divisor. Note the counterintuitive value produced when the dividend and divisor have different signs. | 1 |
=REST(11; −3) | Return the remainder when 11 is divided by −3. The result has the same (negative) sign as the divisor. Note the counterintuitive value produced when the dividend and divisor have different signs. | −1 |
=REST(−11; −3) | Return the remainder when −11 is divided by −3. The result has the same (negative) sign as the divisor. | −2 |
=REST(D1; D2)
where cells D1 and D2 contain the numbers 11,25 and 2,5 respectively. |
Return the remainder when 11,25 is divided by 2,5. The result has the same (positive) sign as the divisor. | 1,25 |
Beslægtede LibreOffice-funktioner:
ODF standard:
Relaterede (eller lignende) Excel-funktioner:
MOD