Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
42c174df0c |
15
fixed_wide_vectors/src/macros/length.rs
Normal file
15
fixed_wide_vectors/src/macros/length.rs
Normal file
@ -0,0 +1,15 @@
|
||||
#[doc(hidden)]
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! impl_length_operations {
|
||||
( $struct: ident { $($field: ident), + }, $size: expr ) => {
|
||||
impl<U,T:Copy+fixed_wide_traits::wide::WideMul<Output=U>> $struct<T> {
|
||||
type Output=$struct<U>;
|
||||
#[inline]
|
||||
fn wide_with_length(self, rhs: Self) -> Self::Output {
|
||||
let len=self.wide_length();
|
||||
let ratio=rhs.ratio(len);
|
||||
self.wide_mul(ratio)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#[cfg(feature="fixed_wide_traits")]
|
||||
pub mod wide;
|
||||
#[cfg(all(feature="fixed_wide_traits",feature="deferred_division"))]
|
||||
pub mod length;
|
||||
|
||||
// Stolen from https://github.com/c1m50c/fixed-vectors (MIT license)
|
||||
#[doc(hidden)]
|
||||
|
Loading…
Reference in New Issue
Block a user