Given an n-place integer and an m-place integer. How can I multiply them in LISP using lists, arrays or any other lisp specific data types?
for instance;
a(1)a(2)…a(n)
b(1)b(2)…b(m)
with result of;
r(1)r(2)…r(m+n)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Common Lisp has already bignums natively. Why don’t you use them?
You basically don’t have to declare anything specially, they “magically” happen:
So with a Common Lisp, you basically don’t have to bother…
addenda
And efficient bignum algorithms are a very difficult problem; Efficient algorithms have better complexity than naive ones; you can find difficult books explaining them (the underlying math is pretty hard). See also this answer.
If you want to make a competitive bignum implementation, be prepared to work hard several years, and make it a PhD thesis.