js-combinatorics
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -22,5 +22,6 @@ /* | ||
'use strict'; | ||
var version = "0.5.3"; | ||
var version = "0.5.4"; | ||
/* combinatory arithmetics */ | ||
var P = function(m, n) { | ||
if (n % 1 !== 0) throw new RangeError; | ||
var p = 1; | ||
@@ -27,0 +28,0 @@ while (n--) p *= m--; |
Package.describe({ | ||
name: 'jandres:js-combinatorics', | ||
version: '0.5.3', | ||
version: '0.5.4', | ||
// Brief, one-line summary of the package. | ||
@@ -5,0 +5,0 @@ summary: 'power set, combination, permutation and more in JavaScript', |
{ | ||
"name": "js-combinatorics", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Simple combinatorics like power set, combination, and permutation in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "combinatorics.js", |
@@ -8,2 +8,8 @@ [![build status](https://secure.travis-ci.org/dankogai/js-combinatorics.png)](http://travis-ci.org/dankogai/js-combinatorics) | ||
### For Swift programmers | ||
Check [swift-combinatorics]. More naturally implemented with generics and protocol. | ||
[swift-combinatorics]: https://github.com/dankogai/swift-combinatorics | ||
SYNOPSIS | ||
@@ -10,0 +16,0 @@ -------- |
@@ -23,2 +23,6 @@ /* | ||
}); | ||
it('[5, 1.5] should throw `RangeError`', function() { | ||
assert.throws(function() { Combinatorics.C(5, 1.5) }, RangeError); | ||
}); | ||
}); |
@@ -160,2 +160,7 @@ /* | ||
])); | ||
// Testing `RangeError` for fractional `nelem` | ||
IT([a, 1.5, "should throw `RangeError`"], function() { | ||
assert.throws(function() { Combinatorics.combination(a, 1.5) }, RangeError); | ||
}); | ||
}); |
@@ -23,2 +23,6 @@ /* | ||
}); | ||
it('[5, 1.5] should throw `RangeError`', function() { | ||
assert.throws(function() { Combinatorics.P(5, 1.5) }, RangeError); | ||
}); | ||
}); |
@@ -175,2 +175,7 @@ /* | ||
])); | ||
// Testing `RangeError` for fractional `nelem` | ||
IT([a, 1.5, "should throw `RangeError`"], function() { | ||
assert.throws(function() { Combinatorics.permutation(a, 1.5) }, RangeError); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1767
297
62733
18