fork(3) download
  1. (defparameter *memo* (make-hash-table))
  2.  
  3. (defun f (n)
  4. (let ((m (gethash n *memo*)))
  5. (if m
  6. m
  7. (setf (gethash n *memo*)
  8. (cond ((= n 0) 4)
  9. ((= n 1) 17/4)
  10. (t (+ (- 108 (/ 815 (f (- n 1))))
  11. (/ 1500 (* (f (- n 1)) (f (- n 2)))))))))))
  12.  
  13. (let ((a (f 80)))
  14. (format t "~A~%" a)
  15. (format t "~,10F~%" a)
  16. ;; stackoverflow.com/a/3321167
  17. (multiple-value-bind (q r) (truncate a)
  18. (format t "~D.~10,'0,D~%" q (truncate (* (abs r) (expt 10 10))))))
  19.  
Success #stdin #stdout 0.01s 29704KB
stdin
Standard input is empty
stdout
206795153138256918939565417139009598365577843034794672964/41359030627651383817474849310671104336332210648235594113
5.0000000000
4.9999999999