rug types are only used if we're on unix

This commit is contained in:
2023-04-07 20:52:18 -07:00
parent e0f36ce112
commit 8982b3b118
6 changed files with 317 additions and 69 deletions

View File

@ -7,12 +7,29 @@ use std::ops::{
};
mod rationalq;
mod floatq;
pub mod quantity;
cfg_if::cfg_if! {
if #[cfg(target_arch = "unix")] {
mod rationalq;
mod floatq;
} else {
mod f64q;
}
}
macro_rules! wrap_rational {
( $x:expr ) => { Quantity::Rational{v: $x} }
}
macro_rules! wrap_float {
( $x:expr ) => { Quantity::Float{v: $x} }
}
pub use crate::quantity::quantity::Quantity;
pub(in crate::quantity) use wrap_rational;
pub(in crate::quantity) use wrap_float;
const FLOAT_PRECISION: u32 = 1024;
const PRINT_LEN: usize = 5; // How many significant digits we will show in output