Skip to content

Commit

Permalink
coef_length def -> defp
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmj authored Feb 29, 2024
1 parent 31999e3 commit 89e7eae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/decimal.ex
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ defmodule Decimal do
exp + coef_adjustment - 1
end

def coef_length(0), do: 1
def coef_length(coef), do: coef_length(coef, 0)
defp coef_length(0), do: 1
defp coef_length(coef), do: coef_length(coef, 0)

def coef_length(0, length), do: length
def coef_length(coef, length), do: coef_length(Kernel.div(coef, 10), length + 1)
defp coef_length(0, length), do: length
defp coef_length(coef, length), do: coef_length(Kernel.div(coef, 10), length + 1)

defp pad_num(%Decimal{coef: coef}, n) do
coef * pow10(Kernel.max(n, 0) + 1)
Expand Down

0 comments on commit 89e7eae

Please sign in to comment.