
답변1
이것이 리눅스에서 할 수 있는 일입니다. 다른 운영 체제에서도 크게 다르지 않아야 합니다.
최신 버전의 LuaTeX를 사용하면 가능합니다. 먼저 Lua 5.x를 이미 설치했다고 가정하고 .so
파일을 만들고 설치합니다(선택 사항이지만 선호됨).
cd /path/to/qd/or/mapm
make
sudo make install
그런 .tex
다음 require
. 다음은 라이브러리에 포함된 테스트의 좋은 예입니다.라마누잔 상수:
%!TEX program = lualatex
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{luacode}
\begin{document}
\begin{luacode*}
--The same in case you use lmapm
qd = require "qd"
tex.print([==[Is $\exp(\pi\sqrt{163})$ an integer?]==])
tex.print("")
a=math.exp(math.pi*math.sqrt(163))
tex.print("fp",string.format("%.64e",a),"\nfrac",a-math.floor(a))
tex.print("")
a=qd.exp(qd.pi*qd.sqrt(163))
tex.print("qd",tostring(a),"\nfrac",tostring(a-qd.floor(a)))
tex.print("")
R=qd.new"2.625374126407687439999999999992500725971981856888793538563373369908627075374103782106479101186073129511813461e17"
tex.print("exact",tostring(R))
\end{luacode*}
\end{document}