CAI GENGYANG <
gengy...@gmail.com> writes:
> I was wondering if there is a limit to this ? What is the largest
> n-tuple for which you can define a function which returns n times its
> argument ?
No limit!
(defmacro define-multiplicator (n)
`(defun ,(intern (substitute-if-not #\- (function alpha-char-p)
(format nil "~:@(~R-UPLE~)" n))) (x)
(* x ,n)))
(pprint (macroexpand-1 '(define-multiplicator #.most-positive-fixnum)))
(defun one-quintillion-one-hundred-fifty-two-quadrillion-nine-hundred-twenty-one-trillion-five-hundred-four-billion-six-hundred-six-million-eight-hundred-forty-six-thousand-nine-hundred-seventy-five-uple (x)
(* x 1152921504606846975))
(one-quintillion-one-hundred-fifty-two-quadrillion-nine-hundred-twenty-one-trillion-five-hundred-four-billion-six-hundred-six-million-eight-hundred-forty-six-thousand-nine-hundred-seventy-five-uple 2)
--> 2305843009213693950
(pprint (macroexpand-1 '(define-multiplicator #.(* (random 1000000) most-positive-fixnum))))
(defun eight-hundred-twenty-five-sextillion-three-hundred-eight-quintillion-four-hundred-eighty-two-quadrillion-seven-hundred-seventy-nine-trillion-two-hundred-sixty-nine-billion-nine-hundred-forty-five-million-four-hundred-thirty-thousand-nine-hundred-seventy-five-uple (x)
(* x 825308482779269945430975))
(eight-hundred-twenty-five-sextillion-three-hundred-eight-quintillion-four-hundred-eighty-two-quadrillion-seven-hundred-seventy-nine-trillion-two-hundred-sixty-nine-billion-nine-hundred-forty-five-million-four-hundred-thirty-thousand-nine-hundred-seventy-five-uple 1/975)
846470238747969174801
--
__Pascal Bourguignon__
http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk