Comparing version 0.0.0 to 0.0.1
@@ -16,2 +16,18 @@ var assert = require("assert"); | ||
it('Infinity should equal Infinity', function() { | ||
var result = number.equal( | ||
Number.POSITIVE_INFINITY, | ||
Number.POSITIVE_INFINITY | ||
); | ||
assert.strictEqual(result, true); | ||
}); | ||
it('+Infinity should not equal -Infinity', function() { | ||
var result = number.equal( | ||
Number.POSITIVE_INFINITY, | ||
Number.NEGATIVE_INFINITY | ||
); | ||
assert.strictEqual(result, false); | ||
}); | ||
it('sign(0) should be 0', function() { | ||
@@ -18,0 +34,0 @@ assert.strictEqual(number.sign(0), 0); |
@@ -26,2 +26,6 @@ /* | ||
} | ||
// We check === here so that +/-Infinity comparisons work correctly | ||
if (x === y) { | ||
return true; | ||
} | ||
if (tolerance == null) { | ||
@@ -28,0 +32,0 @@ tolerance = DEFAULT_TOLERANCE; |
{ | ||
"name": "kmath", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Khan Academy's Javascript Numeric Math Utilities", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -126,3 +126,3 @@ kmath | ||
#### `number.ciel(aNumber, increment)` | ||
#### `number.ceilTo(aNumber, increment)` | ||
@@ -310,5 +310,5 @@ Returns the nearest multiple of `increment` that is no smaller than | ||
#### `vector.cielTo(v, increment)` | ||
#### `vector.ceilTo(v, increment)` | ||
Ciels each dimension of `v` to the nearest `increment`. | ||
Ceils each dimension of `v` to the nearest `increment`. | ||
@@ -319,3 +319,3 @@ | ||
#### `point.is(maybeAPoint, [length]) | ||
#### `point.is(maybeAPoint, [length])` | ||
@@ -444,5 +444,5 @@ Returns true if `maybeAPoint` is an array of numbers. If length is specified, | ||
#### `point.cielTo(p, increment)` | ||
#### `point.ceilTo(p, increment)` | ||
Ciels each dimension of `p` to the nearest `increment`. | ||
Ceils each dimension of `p` to the nearest `increment`. | ||
@@ -449,0 +449,0 @@ |
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
42323
670