08-25-2022, 04:21 PM
(08-25-2022, 04:17 PM)bplus Wrote: I don't like those negative numbers!
Code: (Select All)Do
Input "What ever number "; whatevernumber
bn$ = _Bin$(whatevernumber) 'the binary string returned by _BIN$
dw = 8 'desired field width
If Len(bn$) >= dw Then
Print bn$ 'number already in desired width or even longer
Else
Print Right$(String$(dw, "0") + bn$, dw) 'left padded with zeros
End If
Print "Back to decimal? "; Val("&B" + bn$)
Loop Until whatevernumber = 0
And we haven't even gotten Real yet! like 3 and 1/3 ;-))
b = b + ...