Documentation/Calc Functions/BITHFORSKYD

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


    Funktionsnavn:

    BITHFORSKYD

    Kategori:

    Matematisk

    Resume:

    Forskyder et tal til højre med det bestemte antal bits.

    Syntaks:

    BITHFORSKYD(Number; Shift)

    Returnerer:

    Returnerer et tal forskudt mod højre med det bestemte antal bits.

    Argumenter:

    Tallet er et positivt heltal, der er mindre end less than 2 ^ 48 (281.474.976.710.656).

    Forskyd er antallet af postioner, bits bliver forskudt mod højre. Hvis forskydningen er negativ, er den synonym med BITVFORSKYD(Tal; -Forskyd).

    • * Hvis ét argument er et decimaltal, skal der tages hensyn til dets gulvværdi.
    • Hvis tallet er negativt, returnerer funktionen en fejlkode.
    • If either Number or Shift is a non-integer value, then BITHFORSKYD converts it to an integer by taking its floor value.
    • If Number is less than 0 or greater than 248-1, then BITHFORSKYD reports an invalid argument error (Fejl:502).

    Yderligere oplysninger:

    • * Forskydning af et tal mod højre svarer til at tilføje nuller (0) til venstre i den den binære repræsentation af tallet. For eksempel vil en 3 bits forskydning mod venstre af decimalværdien 6 konvertere dens binære værdi (0110) til 0011 eller 3 decimalt.
    • Med et negativt tal som argumentet Forskyd forskydes antallet af bits til højre. Derfor vil det returnere det samme resultat som et positivt Forskyd-argument i funktionen BITVFORSKYD.
    • More information is available on Wikipedia’s Bitwise operation page.
    • 248 is equal to 281474976710656.

    Eksempler:

    Formula Description Returns
    =BITHFORSKYD(15; 3) 15 is binary 1111. The function shifts this value right by three bits, to give binary 1 or decimal 1. 1
    =BITHFORSKYD(D1; D2) where cells D1 and D2 contain the numbers 6 and -1 respectively. 6 is binary 0110. Because the Shift argument is negative, the function shifts the value 6 left by one bit, to give binary 1100 or decimal 12. 12
    =BITHFORSKYD(15,123; 3,9) The floor values of the two arguments are taken, giving 15 (binary 1111) and 3. The function shifts the value 15 right by three bits, to give binary 1 or decimal 1. 1

    Beslægtede LibreOffice-funktioner:

    BITOG

    BITVFORSKYD

    BITELLER

    BITXELLER

    ODF standard:

    Section 6.6.5, Part 2

    Tilsvarende Excel-funktioner:

    BITRSHIFT since v.2013.