Chapter 22 The num library: 任意精度の有理数

このページは最後に更新されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

last mod. 2008-09-18 (木) 15:23:33

The Objective Caml system release 3.10

num ライブラリは任意精度での整数と有理数の計算を提供します。

このライブラリ関数の詳細なドキュメントは The CAML Numbers Reference Manual by Val駻ie M駭issier-Morain, technical report 141, INRIA, july 1992 にあります (ftp://ftp.inria.fr/INRIA/publication/RT/RT-0141.ps.gz からオンラインで利用できます)。

num ライブラリを使用するプログラムは以下のようにリンクしてください。

       ocamlc other options nums.cma other files
       ocamlopt other options nums.cmxa other files

nums ライブラリを対話式システムで使う場合は以下のようにしてください。

       ocamlmktop -o mytop nums.cma
       ./mytop

(C ライブラリのダイナミックリンクをサポートしているプラットフォームでは) ocaml を起動したあと #load "nums.cma";; と打っても構いません。

  • Module Num: operation on arbitrary-precision numbers
  • Module Big_int: operations on arbitrary-precision integers
  • Module Arith_status: flags that control rational arithmetic

新規 編集 添付