package num

  1. Overview
  2. Docs
The legacy Num library for arbitrary-precision integer and rational arithmetic

Install

Dune Dependency

Authors

Maintainers

Sources

v1.5.tar.gz
md5=b1f9405dfe5f573ea187f122f789ae57
sha512=110dd01140c1c96f5f067aa824bb63f74a26411dcaa65aaf04cb6c44b116ca02aaab9505f431c66964388ce4a31d86da5928b4c0e5557800e834de80bed46495

doc/nums/Arith_status/index.html

Module Arith_status

Flags that control rational arithmetic.

val arith_status : unit -> unit

Print the current status of the arithmetic flags.

val get_error_when_null_denominator : unit -> bool
val set_error_when_null_denominator : bool -> unit

Get or set the flag null_denominator. When on, attempting to create a rational with a null denominator raises an exception. When off, rationals with null denominators are accepted. Initially: on.

val get_normalize_ratio : unit -> bool
val set_normalize_ratio : bool -> unit

Get or set the flag normalize_ratio. When on, rational numbers are normalized after each operation. When off, rational numbers are not normalized until printed. Initially: off.

val get_normalize_ratio_when_printing : unit -> bool
val set_normalize_ratio_when_printing : bool -> unit

Get or set the flag normalize_ratio_when_printing. When on, rational numbers are normalized before being printed. When off, rational numbers are printed as is, without normalization. Initially: on.

val get_approx_printing : unit -> bool
val set_approx_printing : bool -> unit

Get or set the flag approx_printing. When on, rational numbers are printed as a decimal approximation. When off, rational numbers are printed as a fraction. Initially: off.

val get_floating_precision : unit -> int
val set_floating_precision : int -> unit

Get or set the parameter floating_precision. This parameter is the number of digits displayed when approx_printing is on. Initially: 12.

OCaml

Innovation. Community. Security.