Skip to content

Commit b25ebce

Browse files
authored
fix ArithmeticError (#907)
1 parent 026ef36 commit b25ebce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cadet/assessments/assessments.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ defmodule Cadet.Assessments do
11141114
# normalized_voting_score = sum_of_scores / number_of_voters / 10 * 100
11151115
defp calculate_formula_score(sum_of_scores, number_of_voters, tokens) do
11161116
normalized_voting_score = sum_of_scores / number_of_voters / 10 * 100
1117-
normalized_voting_score - :math.pow(2, tokens / 50)
1117+
normalized_voting_score - :math.pow(2, min(1023.5, tokens / 50))
11181118
end
11191119

11201120
@doc """

0 commit comments

Comments
 (0)