Expand description
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 ofLimbtou32instead 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 thetest_buildfeature is enabled. If you want to run unit tests, you must enabletest_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 enablestest_build.
Modules§
- arithmetic
- Traits for arithmetic.
- basic
- Basic traits for working with
Floats. - comparison
- Traits for comparing
Floats for equality or order. - constants
- Functions that produce
Floatapproximations of mathematical constants, using a given precision and rounding mode. - conversion
- Traits for converting to and from
Floats, including convertingFloats to and from strings. - exhaustive
- Iterators that generate
Floats without repetition. - random
- Iterators that generate
Floats randomly.
Structs§
- Comparable
Float ComparableFloatis a wrapper around aFloat, taking theFloatby value.- Comparable
Float Ref ComparableFloatRefis a wrapper around aFloat, taking theFloatbe reference.- Float
- A floating-point number.