@compute.ts/math
Version:
Provide math operators for the computeTS package
1 lines • 1.16 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var array_1=require("@compute.ts/array"),number_1=require("@compute.ts/number"),chai_1=require("chai");require("mocha");var ComputeMathLibrary_1=require("../ComputeMathLibrary");describe("The the mean operator",function(){it("Should be able to perform an evaluation of the mean operator",function(){var e=ComputeMathLibrary_1.mean([1,2,3]);chai_1.expect(e.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the mean operator (expression array)",function(){var e=number_1.number(1),r=number_1.number(2),a=number_1.number(3),a=ComputeMathLibrary_1.mean([e,r,a]);chai_1.expect(a.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the mean operator (array of values)",function(){var e=array_1.array.ofNumber([1,2,3]),e=ComputeMathLibrary_1.mean(e);chai_1.expect(e.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the mean operator (array of expressions)",function(){var e=number_1.number(1),r=number_1.number(2),a=number_1.number(3),a=array_1.array.ofNumber([e,r,a]),a=ComputeMathLibrary_1.mean(a);chai_1.expect(a.eval()).to.equal(2)})});