Einzelnen Beitrag anzeigen

Benutzerbild von Assarbad
Assarbad

Registriert seit: 8. Okt 2010
Ort: Frankfurt am Main
1.234 Beiträge
 
#2

AW: Dezimalzahlen ins Binärsystem

  Alt 4. Nov 2010, 14:55
Das Prinzip ist. Aber es ist deine Aufgabe. Starthilfe hast du nun. Benutze ein logisches UND (in Delphi and).

Code:
if(zahl and $01)then // Box für Bit 0
if(zahl and $02)then // Box für Bit 1
if(zahl and $04)then // Box für Bit 2
if(zahl and $08)then // Box für Bit 3
if(zahl and $10)then // Box für Bit 4
Oliver
"... aber vertrauen Sie uns, die Physik stimmt." (Prof. Harald Lesch)
  Mit Zitat antworten Zitat