Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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