Documentation/Calc Functions/REST

From The Document Foundation Wiki
Jump to navigation Jump to search
This page is a translated version of the page Documentation/Calc Functions/MOD and the translation is 15% complete.
Outdated translations are marked like this.
Other languages:
English • ‎Nederlands • ‎dansk • ‎español • ‎עברית

Template:Documentation/Calc Functions/Func Page Links/da

Funktionsnavn:

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, MOD accepts and processes real numbers with non-zero fractional parts.

Syntaks:

MOD(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.

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{MOD}(x,y)~=~x-\left(y\times \text{INT} \left(\frac{x}{y}\right)\right) }[/math]

The INT 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, MOD may produce results that appear counterintuitive. For example, the formula =MOD(7, -3) returns -2; this is because the fraction [math]\displaystyle{ \left(\frac{7}{-3}\right) }[/math] is rounded to -3 by the INT function.
  • For more general information about the modulo operation, visit Wikipedia’s Modulo operation page.

Eksempler:

Template:Calc-Formula/da Template:Calc-Description/da Template:Calc-Returns/da
=MOD(11; 3) Here the function returns the remainder when 11 is divided by 3. The returned value has the same sign as the divisor, which is positive in this example. 2
=MOD(-11; 3) Here the function returns the remainder when -11 is divided by 3. The returned value has the same sign as the divisor, which is positive in this example. Note the counterintuitive value produced when the dividend and divisor have different signs. 1
=MOD(11; -3) Here the function returns the remainder when 11 is divided by -3. The returned value has the same sign as the divisor, which is negative in this example. Note the counterintuitive value produced when the dividend and divisor have different signs. -1
=MOD(-11; -3) Here the function returns the remainder when -11 is divided by -3. The returned value has the same sign as the divisor, which is negative in this example. -2
=MOD(D1; D2) where cells D1 and D2 contain the numbers 11.25 and 2.5 respectively. Here the function returns the remainder when 11.25 is divided by 2.5. The returned value has the same sign as the divisor, which is positive in this example. 1,25

Beslægtede LibreOffice-funktioner:

QUOTIENT

ODF standard:

Tilsvarende Excel-funktioner:

REST