楼主: ReneeBK
1532 6

Common Lisp Recipes [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4896份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49634 个
通用积分
55.5065
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2016-8-14 22:47:42 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

本帖隐藏的内容

Common Lisp Recipes.pdf (8.95 MB, 需要: 10 个论坛币)


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Recipes Common Recipe Comm CIP

本帖被以下文库推荐

沙发
ReneeBK(未真实交易用户) 发表于 2016-8-14 22:48:15
  1. 4-1. Using Arbitrarily Large Integers
  2. Problem
  3. You are afraid of integer overflow.
  4. Solution
  5. Don’t be!
  6. Here’s a session showing off a few computations with large integers:
  7. ;; see <http://en.wikipedia.org/wiki/Fermat_number>
  8. * (defun fermat (n) (1+ (expt 2 (expt 2 n))))
  9. FERMAT
  10. * (fermat 7)
  11. 340282366920938463463374607431768211457
  12. * (fermat 8)
  13. ;; wrapped around so that it fits on the book page
  14. 1157920892373161954235709850086879078532699846656405640394575840079
复制代码

藤椅
ReneeBK(未真实交易用户) 发表于 2016-8-14 22:49:19
  1. 4-2. Understanding Fixnums
  2. Problem
  3. You’ve learned that COMMON LISP has integers that can be as large as you need, but
  4. you want to know whether it also has “small” integers like in C or JAVA that fit into
  5. the machine’s registers.
  6. Solution
  7. It has. And these numbers are called fixnums. If you run the following code, the
  8. output should be (T NIL T NIL T T) no matter which Lisp you use:7
  9. (loop for n in (list most-positive-fixnum (1+ most-positive-fixnum))
  10. append (loop for type in ’(fixnum bignum integer)
  11. collect (typep n type)))
复制代码

板凳
ReneeBK(未真实交易用户) 发表于 2016-8-14 22:50:17
  1. 4-3. Performing Modular Arithmetic
  2. Problem
  3. You want modular arithmetic the way it is implemented in your computer’s CPU.
  4. Solution
  5. Once you know about the MOD function, it seems pretty obvious that if you want to,
  6. say, multiply 58 with 74051161 and simulate a 32-bit processor, you’d do something
  7. like this
  8. (mod (* 58 74051161) (expt 2 32))
复制代码

报纸
ReneeBK(未真实交易用户) 发表于 2016-8-14 22:51:10
  1. 4-4. Switching Bases
  2. Problem
  3. You want to input or output binary, octal, or hexadecimal numbers. (Or actually
  4. numbers in any base from 2 up to 36.)
  5. Solution
  6. For input, use the sharpsign (#) notation;19 for output, use FORMAT. Try this:
  7. (list (list #b101010 #o52 #x2A)
  8. (loop for fmt in ’("~B" "~O" "~X")
  9. collect (format nil fmt 42)))
复制代码

地板
albertwishedu(未真实交易用户) 发表于 2016-8-15 09:00:40

7
franky_sas(未真实交易用户) 发表于 2016-12-20 12:06:25

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-6 06:44