tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
15
Task/Binary-digits/ACL2/binary-digits.acl2
Normal file
15
Task/Binary-digits/ACL2/binary-digits.acl2
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(include-book "arithmetic-3/top" :dir :system)
|
||||
|
||||
(defun bin-string-r (x)
|
||||
(if (zp x)
|
||||
""
|
||||
(string-append
|
||||
(bin-string-r (floor x 2))
|
||||
(if (= 1 (mod x 2))
|
||||
"1"
|
||||
"0"))))
|
||||
|
||||
(defun bin-string (x)
|
||||
(if (zp x)
|
||||
"0"
|
||||
(bin-string-r x)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue