Jump to content

Binary digits: Difference between revisions

m
m (→‎{{header|Haskell}}: Added a variation)
Line 1,825:
<lang dyalect>func Integer.toString() {
var s = ""
for x in 31^-1..0 {
if this &&& (1 <<< x) != 0 {
s += "1"
} else if s != "" {
Line 1,834:
s
}
 
print("5 == \(5), 50 = \(50), 1000 = \(9000)")</lang>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.