Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Dare committed Jun 21, 2024
1 parent adce61b commit de9c54a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pallets/subtensor/src/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,12 +845,14 @@ impl<T: Config> Pallet<T> {

// Calculate the slope 'a' of the logistic function.
// a = (ln((1 / alpha_high - 1)) - ln((1 / alpha_low - 1))) / (consensus_low - consensus_high)
let a =
(safe_ln((I32F32::from_num(1.0).saturating_div( alpha_high)).saturating_sub(I32F32::from_num(1.0)))
.saturating_sub(safe_ln(
(I32F32::from_num(1.0).saturating_div( alpha_low)).saturating_sub(I32F32::from_num(1.0)),
)))
.saturating_div(consensus_low.saturating_sub(consensus_high));
let a = (safe_ln(
(I32F32::from_num(1.0).saturating_div(alpha_high))
.saturating_sub(I32F32::from_num(1.0)),
)
.saturating_sub(safe_ln(
(I32F32::from_num(1.0).saturating_div(alpha_low)).saturating_sub(I32F32::from_num(1.0)),
)))
.saturating_div(consensus_low.saturating_sub(consensus_high));
log::trace!("a: {:?}", a);

// Calculate the intercept 'b' of the logistic function.
Expand Down

0 comments on commit de9c54a

Please sign in to comment.