
答え1
Linux ではそれができます。他のオペレーティング システムでもそれほど違いはありません。
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}