Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hallo Wolfgang,

Hier hat Micha Kuehn offenbar zwei Operationen verwechselt:

Warum wird im Beispiel
"BITLSHIFT(6;1) ergibt 12" davon ausgeganen, dass die 6 als 0110 zu 
interpretieren ist und nicht als 00000110? 

Diesen Satz verstehe ich nicht; 0110 << 1 = 1100 aka 12, und 00000110
<< 1 = 00001100 aka 12.

Hier wäre das Ergebnis 
gleich, aber wenn ich 6 mit nur drei Stellen angebe (110) wird beim 
SHIFT 101 daraus, also eine 5...

Es gibt einmal die "klassische" SHIFT-Operation, die einfach nur eine
Multiplikation mit Zwei darstellt, was durch "Anfügen einer Null"
beschrieben werden kann.

Das andere ist das, was ich als "circular shift" oder auch
"roll/rotate" kenne: Hier wird das höchste Bit nach dem SHIFT in die
niedrigste Position geschoben. Dabei ist die Breite der Zahl wichtig:

        1101 -> [1]101 -> 101[1] -> 1011

        00001101 -> [0]0001101 -> 0001101[0] -> 00011010


Eine Möglichkeit (bei 3 Stellen): AND(ZAHL;4)/4+BITLSHIFT(ZAHL)

Mit dem ersten AND prüfst du darauf, ob das erste Bit gesetzt ist und
ziehst es an die dritte Stelle ( /4 ). Anschließend führst du das
LSHIFT durch und hängst die vormals 1. Ziffer hinten an.

Gruß,
Michael


-- 
    ____        
   / / / / /__/      Michael Höhne /
  /   / / /  /  mih-hoehne@web.de /
 ________________________________/


-- 
Liste abmelden mit E-Mail an: users+unsubscribe@de.libreoffice.org
Probleme? http://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: http://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: http://listarchives.libreoffice.org/de/users/
Alle E-Mails an diese Liste werden unlöschbar öffentlich archiviert

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.