Skip to content

Commit

Permalink
add a couple tests for untested codepaths in binomial
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski committed Jan 5, 2015
1 parent b5bd61d commit d877d63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/bigint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ end

@test factorial(BigInt(40)) == BigInt("815915283247897734345611269596115894272000000000")
@test binomial(BigInt(1), -1) == BigInt(0)
@test binomial(BigInt(1), 2) == BigInt(0)
@test binomial(BigInt(-53), 42) == BigInt("959509335087854414441273718")
@test binomial(BigInt(113), BigInt(42)) == BigInt("18672199984318438125634054194360")

Expand Down
2 changes: 2 additions & 0 deletions test/combinatorics.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@test factorial(7) == 5040
@test factorial(7,3) == 7*6*5*4
@test binomial(5,-1) == 0
@test binomial(5,10) == 0
@test binomial(5,3) == 10
p = shuffle([1:1000])
@test isperm(p)
Expand Down

0 comments on commit d877d63

Please sign in to comment.