formula-acos
Advanced tools
Comparing version 1.0.0 to 1.0.1
20
ACOS.js
(function (global, factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
define(['exports', 'module', 'formula-isnumber'], factory); | ||
define(['exports', 'module', 'formula-isnumber', 'formula-errors'], factory); | ||
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { | ||
factory(exports, module, require('formula-isnumber')); | ||
factory(exports, module, require('formula-isnumber'), require('formula-errors')); | ||
} else { | ||
@@ -10,6 +10,6 @@ var mod = { | ||
}; | ||
factory(mod.exports, mod, global.isnumber); | ||
factory(mod.exports, mod, global.ISNUMBER, global.error); | ||
global.ACOS = mod.exports; | ||
} | ||
})(this, function (exports, module, _formulaIsnumber) { | ||
})(this, function (exports, module, _formulaIsnumber, _formulaErrors) { | ||
'use strict'; | ||
@@ -21,8 +21,14 @@ | ||
var _isnumber = _interopRequireDefault(_formulaIsnumber); | ||
var _ISNUMBER = _interopRequireDefault(_formulaIsnumber); | ||
function ACOS(number) { | ||
var _error = _interopRequireDefault(_formulaErrors); | ||
return Math.acos(number); | ||
function ACOS(value) { | ||
if (!(0, _ISNUMBER['default'])(value)) { | ||
return _error['default'].value; | ||
} | ||
return Math.acos(value); | ||
} | ||
}); |
{ | ||
"name": "formula-acos", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "ACOS function", | ||
@@ -5,0 +5,0 @@ "main": "ACOS.js", |
@@ -23,4 +23,3 @@ # acos | ||
var acos = require('formula-pmt'); | ||
// 100K at 5% for 360 periods | ||
acos( 1 ) | ||
``` |
@@ -5,4 +5,4 @@ var acos = require('./ACOS'); | ||
describe('n', function() { | ||
it('should convert value to number', function() { | ||
describe('acos', function() { | ||
it('should calculate the inverse cosine', function() { | ||
assert( acos(1) === 0 ); | ||
@@ -9,0 +9,0 @@ assert( acos(NaN) === error.value ); |
Sorry, the diff of this file is not supported yet
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
2360
35
25