Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Map-range/ACL2/map-range.acl2
Normal file
14
Task/Map-range/ACL2/map-range.acl2
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(defun mapping (a1 a2 b1 b2 s)
|
||||
(+ b1 (/ (* (- s a1)
|
||||
(- b2 b1))
|
||||
(- a2 a1))))
|
||||
|
||||
(defun map-each (a1 a2 b1 b2 ss)
|
||||
(if (endp ss)
|
||||
nil
|
||||
(cons (mapping a1 a2 b1 b2 (first ss))
|
||||
(map-each a1 a2 b1 b2 (rest ss)))))
|
||||
|
||||
(map-each 0 10 -1 0 '(0 1 2 3 4 5 6 7 8 9 10))
|
||||
|
||||
;; (-1 -9/10 -4/5 -7/10 -3/5 -1/2 -2/5 -3/10 -1/5 -1/10 0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue