Added Sigma operator – support for more complex operators 🌟
Fix README.md links pointing to Equation.js instead of Equation Bump version to 1.3.0
This commit is contained in:
@ -85,7 +85,25 @@ describe('Constats', () => {
|
||||
expect(M.solve('sin(PI/2)')).to.equal(1);
|
||||
});
|
||||
|
||||
it('should work for functions as constants', () => {
|
||||
it('should work for functions as constants - retry on fail', () => {
|
||||
expect(M.solve('RAND')).to.not.equal(M.solve('RAND'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('Sigma', () => {
|
||||
it('should work with simple expressions', () => {
|
||||
expect(M.solve('sigma(0, 5, @)')).to.equal(15);
|
||||
});
|
||||
|
||||
it('should work with more complex expressions', () => {
|
||||
expect(M.solve('sigma(0, 2, 2@+5)')).to.equal(21);
|
||||
});
|
||||
|
||||
it('should work without an iterator sign', () => {
|
||||
expect(M.solve('sigma(0, 2, 5*2)')).to.equal(30);
|
||||
});
|
||||
|
||||
it('should work with negative start / end points', () => {
|
||||
expect(M.solve('sigma(-5, -2, @)')).to.equal(-14);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user