May 30, 20179 yr I try to put a seed as an option in this function with a default value of nil or no seed , how may i add it as optional Thanks Patrick (defun patkaos ( seed lambda long ) (let ((res (cons seed nil)) (xn seed)) (dotimes (n long res) (setf res (cons (setf xn (* lambda xn (- 1 xn))) res))) (reverse res)))
May 30, 20179 yr Author i looked at it and i tried to put it in the function , but without success This is what i did (defun patkaos ( lambda long &key seed ) (rnd-seed seed ) (let ((res (cons seed nil)) (xn seed)) (dotimes (n long res) (setf res (cons (setf xn (* lambda xn (- 1 xn))) res))) (reverse res))) when i evaluate this is what i gat Error: floating-point-overflow detected > performing * on (-2.5452163E+36 2.5452163E+36) > While executing: ccl::*-2, in process Listener-1(7). > Type cmd-. to abort, cmd-\ for a list of available restarts. > Type :? for other options. Thanks Patrick
Create an account or sign in to comment