#bignum #string-conversion #numeric

bin+lib malachite-float

The arbitrary-precision floating-point type Float, with efficient algorithms partially derived from MPFR

17 releases

0.4.16 Sep 5, 2024
0.4.15 Aug 18, 2024
0.4.14 Jun 22, 2024
0.4.10 May 31, 2024
0.4.1 Sep 21, 2023

#1759 in Math

Download history 253/week @ 2024-07-26 177/week @ 2024-08-02 153/week @ 2024-08-09 575/week @ 2024-08-16 744/week @ 2024-08-23 879/week @ 2024-08-30 600/week @ 2024-09-06 686/week @ 2024-09-13 633/week @ 2024-09-20 626/week @ 2024-09-27 495/week @ 2024-10-04 412/week @ 2024-10-11 640/week @ 2024-10-18 326/week @ 2024-10-25 392/week @ 2024-11-01 471/week @ 2024-11-08

1,959 downloads per month
Used in 12 crates (via malachite)

LGPL-3.0-only

15MB
279K SLoC

Rather than using this crate directly, use the malachite meta-crate. It re-exports all of this crate's public members.

In malachite-float's doctests you will frequently see import paths beginning with malachite_float::. When using the malachite crate, replace this part of the paths with malachite::.

The import path of the Float type is shortened to malachite::Float.

malachite-float

This crate defines Floats.

TODO

Malachite is developed by Mikhail Hogrefe. Thanks to b4D8, florian1345, konstin, Rowan Hart, YunWon Jeong, Park Joon-Kyu, Antonio Mamić, OliverNChalk, and shekohex for additional contributions.

Copyright © 2024 Mikhail Hogrefe


lib.rs:

This crate defines Floats, which are arbitrary-precision floating-point numbers.

Floats are currently experimental. They are missing many important functions. However, the functions that are currently implemented are thoroughly tested and documented, with the exception of string conversion functions. The current string conversions are incomplete and will be changed in the future to match MPFR's behavior.

Demos and benchmarks

This crate comes with a bin target that can be used for running demos and benchmarks.

  • Almost all of the public functions in this crate have an associated demo. Running a demo shows you a function's behavior on a large number of inputs. TODO
  • You can use a similar command to run benchmarks. TODO

The list of available demos and benchmarks is not documented anywhere; you must find them by browsing through bin_util/demo_and_bench.

Features

  • 32_bit_limbs: Sets the type of Limb to [u32] instead of the default, [u64].
  • test_build: A large proportion of the code in this crate is only used for testing. For a typical user, building this code would result in an unnecessarily long compilation time and an unnecessarily large binary. My solution is to only build this code when the test_build feature is enabled. If you want to run unit tests, you must enable test_build. However, doctests don't require it, since they only test the public interface.
  • bin_build: This feature is used to build the code for demos and benchmarks, which also takes a long time to build. Enabling this feature also enables test_build.

Dependencies

~2–12MB
~149K SLoC