mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-05 16:18:13 -07:00
computer: add tx annualized volume + tx velocity + rename _in_usd/_in_btc to _usd/_btc
This commit is contained in:
@@ -134,3 +134,8 @@ impl CheckedSub<usize> for Bitcoin {
|
||||
Some(Self(self.0 - rhs as f64))
|
||||
}
|
||||
}
|
||||
impl CheckedSub<Bitcoin> for Bitcoin {
|
||||
fn checked_sub(self, rhs: Bitcoin) -> Option<Self> {
|
||||
Some(Self(self.0 - rhs.0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,3 +175,10 @@ impl Sum for StoredF64 {
|
||||
Self(iter.map(|v| v.0).sum::<f64>())
|
||||
}
|
||||
}
|
||||
|
||||
impl Div<Bitcoin> for StoredF64 {
|
||||
type Output = Self;
|
||||
fn div(self, rhs: Bitcoin) -> Self::Output {
|
||||
Self(self.0 / f64::from(rhs))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user