Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Binary-digits/Dyalect/binary-digits.dyalect
Normal file
13
Task/Binary-digits/Dyalect/binary-digits.dyalect
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
func Integer.ToString() {
|
||||
var s = ""
|
||||
for x in 31^-1..0 {
|
||||
if this &&& (1 <<< x) != 0 {
|
||||
s += "1"
|
||||
} else if s != "" {
|
||||
s += "0"
|
||||
}
|
||||
}
|
||||
s
|
||||
}
|
||||
|
||||
print("5 == \(5), 50 = \(50), 1000 = \(9000)")
|
||||
Loading…
Add table
Add a link
Reference in a new issue