Skip to content

Using https://docs.rs/num-bigint/latest/num_bigint/ in units conversion #4025

Open
@younies

Description

@younies

We would like to check the feasibility for using num bigint in order to represent the numerator and denominator for the conversion factors.

  1. Supporting std can be turned off
  2. The data stored in a vector of Bigdigit Vec<BigDigit> and we can choose the type BigDigit to be u32 or u64. See the snippet of the code bellow
  3. It supports the basic calculation operations such as mul, div and mod.

mod big_digit {
    /// A [`BigDigit`] is a [`BigUint`]'s composing element.
    #[cfg(not(u64_digit))]
    pub(crate) type BigDigit = u32;
    #[cfg(u64_digit)]
    pub(crate) type BigDigit = u64;

Metadata

Metadata

Assignees

Labels

A-designArea: Architecture or designC-numbersComponent: Numbers, units, currencies

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions