138 Commits

Author SHA1 Message Date
jos
9faf91f697 Convert all data types, converted all algebra functions. Fixes in order of importing factories. 2018-11-08 15:02:18 +01:00
jos
2fd6cbd568 Converted matrix classes. Fixes in dependency resolving/ordering. 2018-11-07 12:38:00 +01:00
jos
a2ae756fd1 Remove semicolons 2018-10-31 21:18:51 +01:00
jos
247aeabffa Refactor all unit tests to ES6 import/export 2018-10-31 21:17:23 +01:00
greenkeeper[bot]
c5971b371a Update standard to the latest version 🚀 (#1226)
* chore(package): update standard to version 12.0.0

* update to new lint version with --fix

I believe this mainly adds whitespace to `{}`'s.

* Replace assert.equal with assert.strictEqual

This breaks a lot of tests which I will endevour to fix in the next
commits.

* Fix most errors due to assert.strictEquals

Some instances of `strictEquals` are replaced by `deepEquals`.
`toString` has been used to make some string comparisions explicit.
Tests will still fail untill #1236 and #1237 are fixed.

* Fix assertion erros due to -0

With node 10, assert.strictEqual no longer considers `0 === -0`.
I missed these first time round as I was using node 8.

* Put toString correct side of bracket

I was converting the constructor to a string rather
than the result of the computation. Oops.

* Fixed #1236: quantileSeq has inconsistant return

* Update package-lock

* Fixed #1237: norm sometimes returning a complex number instead of number

* Fix cli tests

* More changes for standardjs, and fixes in unit tests
2018-09-08 16:33:58 +02:00
Paulo Buchsbaum
443d42a7fc Bugfixes in rationalize, extended simplify with new options see #1173
Fix of bug fixes in `rationalize.js`, also changing  `simplify.js` and `simplifyConstant.js` and more  2 bugs in `simplify.js` and `simplifyconstant.js` in order to be possible passing in `Travis` test. 

**Bugs in `simplifyConstant.js` and   `simplify.js`**

1. `simplifyConstant.js` - I've changed `new ConstantNode(stringNumber, 'number')` to `new ConstantNode(number)`

1.  `simplify.js` - Due to problems with a  number node with  string type,  I've added `!isNaN(node.value)))` in number type test condition 

**Bugs in `rationalize.js`**

3.   I've fixed  negative power exponents and decimals coefficients troubles. The decimals coefficients problem has led to the need to add a new feature in `simplify.js ` and `simplifyConstant.js` (next topic)

**New feature in `simplify.js` and `simplifyConstant.js`**

4.  New rule type (string), whose valid values are in `listCommStrings` new variable. The only string rule accepted so far is to turn off exact fraction conversion in `simplifyConstant.js`
2018-08-03 15:58:45 +02:00
jos
e04d158eaa Some larger timeouts for tests to prevent accidental failure on IE/Edge 2018-07-07 13:21:18 +02:00
jos
c3827d7411 Fixed #1137: simplify unnecessarily replacing implicit multiplication with explicit multiplication 2018-07-06 22:17:43 +02:00
jos
a9b9ed029e Merge branch 'develop' into fix/simplify_implicit_multiplication 2018-07-06 21:00:40 +02:00
jos
0d93fff878 Fixed #1146: rationalize throwing exceptions for some input with decimals 2018-07-04 21:06:55 +02:00
jos
06dda6fc95 Fix keeping implicit multiplication in simplify (WIP) 2018-07-01 15:10:43 +02:00
Harry Sarson
61396e54cc
remove timeout extension from rationalize test 2018-06-19 16:28:31 +01:00
Harry Sarson
815cade14c
speed up rationalize tests
This commit tests the processing of power expressions using a smaller exponent (3 vs 6) and
moves a particulary slow expandsion into a seperate test which is then skipped.
2018-06-19 16:28:13 +01:00
jos
9170e27618 Don't use multi line strings 2018-06-13 17:59:33 +02:00
jos
0583771e4e Cleanup unused variables and imports 2018-06-13 17:25:51 +02:00
jos
f1ce473457 Consistend camel case naming of variables and functions 2018-06-13 16:09:51 +02:00
jos
1f0a37a0cb Split initialized 'const' declarations into multiple statements 2018-06-13 15:31:37 +02:00
jos
17f07ec098 Fixed incompatibility with v4 (index.js file) 2018-06-13 14:02:50 +02:00
jos
b3b96749bf Refactored var into const/let, and removed a lot of semicolons 2018-06-13 12:21:14 +02:00
jos
934ea83df7 Fixed linting issues "Expected consistent spacing" 2018-06-12 21:38:11 +02:00
jos
024b2a9e26 Fix most lint errors using npx standard --fix 2018-06-10 20:28:27 +02:00
jos
b3568a4c4a Merge branch 'fix-derivative-tex' of https://github.com/joelhoover/mathjs into joelhoover-fix-derivative-tex 2018-06-10 14:08:56 +02:00
Joel Hoover
6722b448d1 Merge branch 'develop' into fix-derivative-tex 2018-06-07 21:43:20 -04:00
Joel Hoover
d2164c4fc5 Properly handle TeXing of 'derivative', and added test cases for regression (fixes josdejong/mathjs#1103) 2018-06-07 21:39:16 -04:00
jos
635cd0b574 Revert using /lib/ in tests, use /src/ again. Fixed coverage testing. WIP 2018-06-06 22:11:52 +02:00
jos
79071b5e4f Fixed npm run test:browser not working (WIP) 2018-06-06 21:30:41 +02:00
jos
0c084b8e20 npm test working now 2018-06-06 15:36:36 +02:00
jos
cf5c1c1af8 Fixes #1054: renamed eye to identity 2018-06-06 10:52:08 +02:00
Harry Sarson
29052cbdcc
use math.create() to prevent tests changing global state.
Tests should not import functions into global math namespace.
2018-05-01 17:40:57 +01:00
Harry Sarson
c23761bee0
separate tests that depend on node
Ddds new directory 'test/node' for tests which require node.
In practice these tests are the ones that depend on matrixmarket.
2018-05-01 17:38:51 +01:00
jos
229ff3d8ff Fixed #1063: derivative not working when resolving a variable with unary minus like math.derivative('-x', 'x') 2018-04-11 13:25:44 +02:00
jos
bf3f62b564 Upgraded to typed-function@1.0.0 2018-02-20 20:59:05 +01:00
jos
99ab11b234 Dropped constant uninitialized 2018-02-04 13:09:09 +01:00
Jos de Jong
cdda817d9f
Merge pull request #1036 from ericman314/implicit-multiplication
Implicit multiplication
2018-02-04 11:55:15 +01:00
Eric Mansfield
17a4e33ae2 Added tests 2018-02-02 21:14:33 -07:00
jos
82b41e696a - Implemented OperatorNode.isUnary and OperatorNode.isBinary.
- Explicit checks for number of arguments everywhere working with `OperatorNode` and `FunctionNode`.
- Fixed #1014: derivative silently ignoring additional arguments.
2018-01-31 11:00:39 +01:00
jos
3f3d50f7a0 Fixed #833: the constants true, false, null, undefined, NaN, Infinity, and uninitialized are now parsed as ConstantNodes instead of SymbolNodes in the expression parser 2018-01-23 13:55:57 +01:00
jos
3af55ededa Merge branch 'simplify2' into develop 2018-01-17 12:16:05 +01:00
Karl Lew
c4b555c36f #1018 simplifyCore ParenthesisNode 2018-01-16 09:06:24 -08:00
jos
8724ae0ae5 Fixed #1013: simplify wrongly simplifing some expressions containing unary minus, like 0 - -x 2018-01-13 14:37:27 +01:00
Jos de Jong
4504c3cc2a
Merge pull request #1003 from HarrySarson/3-arg-derivative
Improves derivative for 3 argument nodes. Closes #1002
2018-01-13 12:32:56 +01:00
Joel Hoover
6e6d0e37b1 Handle error in simplifyConstants when a function has all numeric arguments but is not itself defined 2018-01-08 01:13:14 -05:00
Joel Hoover
77dcd5abe9 Do not let simplifyConstants binarize functions with more than two arguments 2018-01-08 00:42:26 -05:00
Harry Sarson
05e6de2fd9 adds constant node checking with 3+ args 2018-01-04 14:25:05 +00:00
Harry Sarson
59e4c4ca97 derivative correctly handles '+' and '*' with three args 2018-01-04 13:42:00 +00:00
Joel Hoover
97098adad7 Added rule to simplify that allows for combining of like terms in embedded quantities 2018-01-02 01:02:19 -05:00
jos
67eeaea740 Merge branch 'simplify2' into develop 2017-12-28 17:08:46 +01:00
Karl Lew
f1d0beb252 fix for #998 unary minus bug 2017-12-26 15:34:11 -08:00
Jos de Jong
e4ea1eb2aa
Merge pull request #981 from jeffreyshen19/master
Added a test for ln(x) derivative
2017-12-05 20:49:23 +01:00
jeffreyshen19
8bbed26a2b added a test for ln(x) derivative 2017-12-05 00:06:10 -05:00