Comparing version 0.0.2 to 0.0.3
@@ -13,3 +13,3 @@ /** | ||
var version = '0.0.2'; | ||
var version = '0.0.3'; | ||
@@ -103,4 +103,4 @@ function digit(list) { | ||
var _digit = Math.pow(10, digit(arguments)); | ||
var result = 0; | ||
for (var i = 0; i < arguments.length; i++) { | ||
var result = arguments[0] * _digit || 0; | ||
for (var i = 1; i < arguments.length; i++) { | ||
result += arguments[i] * _digit; | ||
@@ -113,4 +113,4 @@ } | ||
var _digit = Math.pow(10, digit(arguments)); | ||
var result = 0; | ||
for (var i = 0; i < arguments.length; i++) { | ||
var result = arguments[0] * _digit || 0; | ||
for (var i = 1; i < arguments.length; i++) { | ||
result -= arguments[i] * _digit; | ||
@@ -123,4 +123,4 @@ } | ||
var _digit = Math.pow(10, digit(arguments)); | ||
var result = 1; | ||
for (var i = 0; i < arguments.length; i++) { | ||
var result = arguments[0] * _digit || 0; | ||
for (var i = 1; i < arguments.length; i++) { | ||
result *= arguments[i] * _digit; | ||
@@ -132,3 +132,3 @@ } | ||
CalcJs.prototype.div = function() { | ||
var result = arguments[0]; | ||
var result = arguments[0] || 0; | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -135,0 +135,0 @@ result /= arguments[i]; |
{ | ||
"name": "calcjs", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "calcjs", | ||
"main": "calcjs.js", | ||
"scripts": { | ||
"test": "mocha -r should -R spec --recursive test", | ||
"jshint": "jshint calcjs.js" | ||
}, | ||
"repository": { | ||
@@ -11,3 +15,5 @@ "type": "git", | ||
"keywords": [ | ||
"calcjs" | ||
"calcjs", | ||
"calc", | ||
"math" | ||
], | ||
@@ -18,3 +24,7 @@ "author": "Yuhei Aihara", | ||
"url": "https://github.com/yuhei-a/calcjs/issues" | ||
}, | ||
"devDependencies": { | ||
"should": "~3.3.1", | ||
"mocha": "~1.18.2" | ||
} | ||
} |
@@ -79,1 +79,4 @@ CalcJs | ||
``` | ||
## Test | ||
Run `npm test` and `npm run-script jshint` |
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
13336
40
6
162
82
2