Documentation/Calc Functions/REST

    From The Document Foundation Wiki
    This page is a translated version of the page Documentation/Calc Functions/MOD and the translation is 5% complete.
    Outdated translations are marked like this.
    Other languages:


    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, 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.

    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{\lt span lang="en" dir="ltr" class="mw-content-ltr"\gt MOD\lt /span\gt }(x,y)~=~x-\left(y\times \text{\lt span lang="en" dir="ltr" class="mw-content-ltr"\gt INT\lt /span\gt } \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:

    Formula Description Returns
    =REST(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
    =REST(−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
    =REST(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
    =REST(−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
    =REST(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:

    KVOTIENT

    ODF standard:

    Tilsvarende Excel-funktioner:

    REST