package bignum

  1. Overview
  2. Docs
Core-flavoured wrapper around zarith's arbitrary-precision rationals

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=7acc936acbaaf71b2c1518e09b7651bec20d8dc72a990c871c40a74b63b1a8ed

CHANGES.md.html

Release v0.17.0

  • Added local_-mode functions compare ~localize, equal ~localize, and globalize derivations

  • Added infinity and neg_infinity to Bignum

  • Functionality extensions for rounding: round, iround, round_as_bigint, iround_exn, round_as_bigint_exn, and round_decimal functions now support Bankers rounding direction

  • Changes to Stable and Unstable modules:

    • Removed automatic equal derivation from Stable.t and Unstable.t

    • Added custom equal functions to Stable and Unstable modules that adhere to IEEE float semantics, treating nan as not equal to nan

Release v0.16.0

  • Big_int

    • Adds stable_witness derivation to both the BigInt.Stable.V1 and BigInt.Stable.V2 modules. This facilitates compatibility checks between different versions of serialized data

  • Big_num

    • Add deriving attributes:

      • Bignum.t, Bignum.Stable.t, and Bignum.Unstable.t derive sexp_grammar

    • Add new functions to Bignum:

      • truncate: Rounds the input towards zero to an integer

      • is_infinite: Returns true if the number is either positive or negative infinity

      • is_positive_infinity: Returns true if the number is positive infinity

      • is_negative_infinity: Returns true if the number is negative infinity

    • Add arg_type to Bignum, for ease of use in Command.t based parsers

Old pre-v0.15 changelogs (very likely stale and incomplete)

113.33.00

  • This release improves the slow path of bignum of string. The previous version used a split on '_' followed by a concat, which allocated a bunch of intermediate strings.

113.24.00

  • Switched to PPX.

  • The library used polymorphic compare, rather than Zarith.Q's compare, in a few locations. Fixed this.

  • Previously stable types in Bignum were defined with unstable types in the scope. Fixd this.

  • Update to zarith-1.4

113.00.00

  • Fixed a bug in the =Zarith= library's to_float function.

    These fixes first introduce tests from the base distribution, and then backport a bugfix to the handling of to_float.

112.35.00

  • Upgraded from Zarith 1.2 to 1.3.

  • Removed dependence on Big_int.

112.24.00

  • Fixed exception raised by Bignum.sexp_of_t when the denominator is zero.

112.17.00

  • Added Bigint.random function, which produces a uniformly distributed value.

112.06.00

  • Added functions to round from Bignum.t to Bigint.t, and to convert Bigint.t into Bignum.t.

112.01.00

  • Added Bignum.Bigint module, with arbitrary-precision integers based on Zarith, which is significantly faster than the Num.Big_int library.

111.17.00

  • Improved the performance of binprot deserialization by removing the allocation of an intermediate type.

111.13.00

  • Eliminated the dependence of Bignum on Re2, and reduced dependence from Core to Core_kernel.

  • Extended the rounding interface to bring it in line with int and float rounding.

  • Improved the performance of Bignum's binprot.

    Bignum's binprot had been to just binprot the decimal string representation. This is both slow to do and unnecessarily big in the majority of cases. Did something better in the majority of cases and fell back to this representation in the exceptional case.

      $ ./inline_benchmarks_runner
      Estimated testing time 20s (2 benchmarks x 10s). Change using -quota SECS.
    
    Name Time/Run mWd/Run Percentage
    bignum0.ml:Stable:Bignum binprot roundtrip compact 7.87us 490.00w 32.88%
    bignum0.ml:Stable:Bignum binprot roundtrip classic 23.94us 1_079.00w 100.00%
OCaml

Innovation. Community. Security.