pub type Integer = i32;
pub type BigInteger = i64;
pub type Natural = u32;
pub type BigNatural = u64;
pub type Real = f64;
pub type Complex = num_complex::Complex<Real>;
pub type Decimal = Real;
pub type Size = usize;
pub type Time = Real;
pub type DiscountFactor = Real;
pub type Rate = Real;
pub type Spread = Real;
pub type Volatility = Real;
pub type Probability = Real;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn type_widths_match_quantlib_defaults() {
assert_eq!(size_of::<Real>(), 8);
assert_eq!(size_of::<Integer>(), 4);
assert_eq!(size_of::<BigInteger>(), 8);
assert_eq!(size_of::<Natural>(), 4);
assert_eq!(size_of::<BigNatural>(), 8);
assert_eq!(size_of::<Size>(), size_of::<usize>());
}
#[test]
fn semantic_aliases_are_real() {
let _t: Time = 1.0;
let _r: Rate = 0.05;
let _s: Spread = 0.01;
let _v: Volatility = 0.2;
let _d: Decimal = 2.5;
let _df: DiscountFactor = 0.99;
let _p: Probability = 0.5;
}
}