From 7c0ad5b6018f7715b152fd60dc9cf64a163a9605 Mon Sep 17 00:00:00 2001 From: Quaternions <krakow20@gmail.com> Date: Thu, 6 Feb 2025 13:35:19 -0800 Subject: [PATCH] common: integer: Time <-> Ratio --- lib/common/src/integer.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/common/src/integer.rs b/lib/common/src/integer.rs index 018b1f0..70bb9e3 100644 --- a/lib/common/src/integer.rs +++ b/lib/common/src/integer.rs @@ -63,6 +63,12 @@ impl<T> From<Planar64> for Time<T>{ Self::raw((value*Planar64::raw(1_000_000_000)).fix_1().to_raw()) } } +impl<T> From<Time<T>> for Ratio<Planar64,Planar64>{ + #[inline] + fn from(value:Time<T>)->Self{ + value.to_ratio() + } +} impl<T,Num,Den,N1,T1> From<Ratio<Num,Den>> for Time<T> where Num:core::ops::Mul<Planar64,Output=N1>,