Crates.io | relp-num |
lib.rs | relp-num |
version | |
source | src |
created_at | 2021-05-12 21:42:20.791116 |
updated_at | 2024-10-01 13:54:50.149309 |
description | Number types for the relp crate |
homepage | |
repository | https://github.com/vandenheuvel/relp-num |
max_upload_size | |
id | 396705 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Number types for the Relp crate, most notably arbitrary precision rationals.
Add this to your Cargo.toml
:
[dependencies]
relp-num = "0.1.13"
You can now use the crate, for example to compute 2 + 2
:
fn main() {
println!("{}", relp_num::RB!(2) + relp_num::R64!(2));
}
The first number is represented in arbitrary precision (type RationalBig), the second one smaller (type Rational64) with 64 bits of precision for both the numerator and denominator.
The RELP crate computes with rational numbers that have specific properties. They need to be arbitrary precision, but are often small. Performance is critical and as such these specific properties should be exploited. This crate does exactly that.
Specific linear programs that one wishes to solve with RELP might have specific properties. RELP allows the user to specialize default implementations in order to exploit these. This numerics crate contains default implementations of number types for this usecase.
There are already some great general purpose numerics libraries out there, such as
This crate is not trying to be one of them and exists to support RELP only.