2024-08-23 21:17:48 +00:00
|
|
|
use fixed_wide::wide::WideMul;
|
2024-08-23 20:00:22 +00:00
|
|
|
|
|
|
|
type Planar64=fixed::types::I32F32;
|
|
|
|
type Planar64Wide1=fixed::types::I64F64;
|
2024-08-23 22:23:40 +00:00
|
|
|
type Planar64Wide2=fixed_wide::types::I128F128;
|
|
|
|
type Planar64Wide3=fixed_wide::types::I256F256;
|
2024-08-23 20:00:22 +00:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn it_works() {
|
2024-08-23 21:17:48 +00:00
|
|
|
let a=Planar64::from(2);
|
|
|
|
let b=Planar64::from(3);
|
|
|
|
|
|
|
|
let w1=a.wide_mul(b);
|
|
|
|
let w2=w1.wide_mul(w1);
|
|
|
|
let w3=w2.wide_mul(w2);
|
|
|
|
|
|
|
|
assert_eq!(w3,Planar64Wide3::from(1296));
|
2024-08-23 20:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
pub fn main(){
|
|
|
|
let max=i32::MAX as i64;
|
|
|
|
println!("{} {}",max*max,i64::MAX);
|
|
|
|
}
|
|
|
|
}
|