fn approved(
		&self,
		approve: Balance,
		against: Balance,
		voters: Balance,
		electorate: Balance,
	) -> bool {
		let sqrt_voters = voters.integer_sqrt();
		let sqrt_electorate = electorate.integer_sqrt();
		if sqrt_voters.is_zero() { return false; }
		match *self {
			VoteThreshold::SuperMajorityApprove =>
				compare_rationals(against, sqrt_voters, approve, sqrt_electorate),
			VoteThreshold::SuperMajorityAgainst =>
				compare_rationals(against, sqrt_electorate, approve, sqrt_voters),
			VoteThreshold::SimpleMajority => approve > against,
		}
	}
/// Return true if the overall outcome is in favor of approval.
///
/// - `approve` is the number of votes approving of a proposal.
/// - `against` is the number of votes against a proposal.
/// - `voters` is the total number of voters who voted.
/// - `electorate` is the total electorate size.
///
/// We assume each *voter* may cast more than one *vote*, hence `voters` is not necessarily equal to
/// `approve + against`. Likewise, `electorate - voters` are abstainers.
///
/// If `self` is a `SuperMajority` variant, this implements *Adaptive Quorum Biasing* such
/// that the required supermajority increases with lower turnout. As turnout approaches 100%,
/// the required majority approaches 50%.
Return true if the overall outcome is in favor of approval.
`approve` is the number of votes approving of a proposal.
`against` is the number of votes against a proposal.
`voters` is the total number of voters who voted.
`electorate` is the total electorate size.

We assume each *voter* may cast more than one *vote*, hence `voters` is not necessarily equal to
`approve + against`. Likewise, `electorate - voters` are abstainers.

If `self` is a `SuperMajority` variant, this implements *Adaptive Quorum Biasing* such
that the required supermajority increases with lower turnout. As turnout approaches 100%,
the required majority approaches 50%.
Return true if the overall outcome is in favor of approval . ` approve ` is the number of votes approving of a proposal . ` against ` is the number of votes against a proposal . ` voters ` is the total number of voters who voted . ` electorate ` is the total electorate size . We assume each * voter * may cast more than one * vote * hence ` voters ` is not necessarily equal to ` approve + against ` . Likewise ` electorate - voters ` are abstainers . If ` self ` is a ` SuperMajority ` variant this implements * Adaptive Quorum Biasing * such that the required supermajority increases with lower turnout . As turnout approaches 100% the required majority approaches 50% .
fn approved(
		&self,
		approve: Balance,
		against: Balance,
		voters: Balance,
		electorate: Balance,
	) -> bool {
		let sqrt_voters = voters.integer_sqrt();
		let sqrt_electorate = electorate.integer_sqrt();
		if sqrt_voters.is_zero() { return false; }
		match *self {
			VoteThreshold::SuperMajorityApprove =>
				compare_rationals(against, sqrt_voters, approve, sqrt_electorate),
			VoteThreshold::SuperMajorityAgainst =>
				compare_rationals(against, sqrt_electorate, approve, sqrt_voters),
			VoteThreshold::SimpleMajority => approve > against,
		}
	}
fn approved ( & self , approve : Balance , against : Balance , voters : Balance , electorate : Balance , ) -> bool { let sqrt_voters = voters . integer_sqrt ( ) ; let sqrt_electorate = electorate . integer_sqrt ( ) ; if sqrt_voters . is_zero ( ) { return false ; } match * self { VoteThreshold :: SuperMajorityApprove => compare_rationals ( against , sqrt_voters , approve , sqrt_electorate ) , VoteThreshold :: SuperMajorityAgainst => compare_rationals ( against , sqrt_electorate , approve , sqrt_voters ) , VoteThreshold :: SimpleMajority => approve > against , } }
Return true if the overall outcome is in favor of approval.
Return true if the overall outcome is in favor of approval .
&self
approve
Balance
against
Balance
voters
Balance
electorate
Balance
&self
approve
Balance
against
Balance
voters
Balance
electorate
Balance