1 (defpackage "SB-MPFR-TESTS"
2 (:use
"COMMON-LISP" "SB-RT"))
4 (in-package "SB-MPFR-TESTS")
7 (let ((sb-mpfr:*mpfr-rnd
* :MPFR_RNDD
))
8 (sb-mpfr:with-precision
200
9 (let ((u (sb-mpfr:coerce
1.0d0
'sb-mpfr
:mpfr-float
)))
10 (loop for i from
1 to
100
11 for v
= u then
(sb-mpfr:mul v i
:MPFR_RNDU
)
12 collect
(sb-mpfr:div u v
)
14 finally
(return (sb-mpfr:sum
(cons u vals
))))))))
17 (let ((sb-mpfr:*mpfr-rnd
* :MPFR_RNDD
))
18 (sb-mpfr:with-precision
200
19 (let* ((u (sb-mpfr:coerce
1.0d0
'sb-mpfr
:mpfr-float
))
21 (loop for i from
1 to
100
22 for v
= u then
(sb-mpfr:mul v i
:MPFR_RNDU
)
23 do
(setf s
(sb-mpfr:add s
(sb-mpfr:div u v
)))
24 finally
(return s
))))))
27 (sb-mpfr:set-precision
400)