Skip to content

Commit 8384650

Browse files
committed
Include current .formatter.exs and apply
This will make things easier as I addjust stuff without requiring a lot of manual adjustment. The repo seems to be largely in line with the 1.6 settings anyway
1 parent 6e43108 commit 8384650

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

.formatter.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Used by "mix format"
2+
[
3+
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"]
4+
]

lib/statistics/distributions/hypergeometric.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ defmodule Statistics.Distributions.Hypergeometric do
3333

3434
true ->
3535
xk = Math.to_int(k)
36-
Math.combination(pk, xk) * Math.combination(pn-pk, n-xk) / Math.combination(pn, n)
36+
Math.combination(pk, xk) * Math.combination(pn - pk, n - xk) / Math.combination(pn, n)
3737
end
3838
end
3939
end

mix.exs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ defmodule Statistics.Mixfile do
44
@version "0.6.1"
55

66
def project do
7-
[ app: :statistics,
7+
[
8+
app: :statistics,
89
version: @version,
910
elixir: ">= 1.5.0",
1011
description: description(),
1112
package: package(),
12-
deps: deps() ]
13+
deps: deps()
14+
]
1315
end
1416

1517
def application do
@@ -36,5 +38,4 @@ defmodule Statistics.Mixfile do
3638
links: %{"GitHub" => "https://github.com/msharp/elixir-statistics"}
3739
]
3840
end
39-
4041
end

test/exponential_distribution_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ defmodule ExponentialDistributionTest do
3838
test "generating many random variates gives roughly the expected mean" do
3939
n = 100_000
4040
lambda = 0.002
41-
expected_mean = 1/lambda
42-
sample_mean = Enum.sum(Enum.map(1..n, fn _ -> Exponential.rand(lambda) end))/n
41+
expected_mean = 1 / lambda
42+
sample_mean = Enum.sum(Enum.map(1..n, fn _ -> Exponential.rand(lambda) end)) / n
4343

4444
assert 0.95 * expected_mean <= sample_mean
4545
assert sample_mean <= 1.05 * expected_mean

test/hypergeometric_distribution_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ defmodule HypergeometricDistributionTest do
3636
# cannot be less than zero
3737
assert r >= 0
3838
end
39-
end
39+
end

0 commit comments

Comments
 (0)