$iDecimal = InputBox("Dezimal", "Geben Sie eine ganzstellige Dezimalzahl ein:") If $iDecimal <> Int($iDecimal) Then $iDecimal = Int($iDecimal) $bNumber = _DecToBinary($iDecimal) MsgBox(64, "Binär", "Die Dezimalzahl " & $iDecimal & " ist als binäre Zahl: " & $bNumber & ".") Func _DecToBinary($iDecimal) Local $bReturn, $bSign = False If $iDecimal < 0 Then $iDecimal = StringTrimLeft($iDecimal, 1) $bSign = True EndIf Do $bReturn = Mod($iDecimal, 2) & $bReturn If $iDecimal / 2 <> Int($iDecimal / 2) Then $iDecimal = StringTrimRight($iDecimal / 2, 2) Else $iDecimal /= 2 EndIf Until $iDecimal = 0 If $bSign = True Then $bReturn = "-" & $bReturn Return $bReturn EndFunc