306 Commits

Author SHA1 Message Date
jos
8cab3f2bb0 Release v5.1.2 2018-09-09 13:52:51 +02:00
Harry Sarson
5750a18454 Upgrade to babel 7 (#1234) 2018-09-08 19:34:18 +02: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
jos
9b530aa597 Fixed #1222: a typo in the docs of subset. Updated history 2018-08-25 13:06:24 +02:00
jos
0ed6a25165 Release v5.1.1 2018-08-21 21:41:56 +02:00
jos
56a52f6dfd Fix unit tests broken on Nodejs 6 and 8 (no proper NaN assertions) 2018-08-21 21:27:11 +02:00
jos
b6ab40cf88 Fixed #1214: median and other functions not neatly handling NaN 2018-08-21 21:16:15 +02:00
jos
9b2d2d4611 Release v5.1.0 2018-08-12 21:35:20 +02:00
Jason Shin
c4662ab3bb Implemented function getMatrixDataType (#1172)
* getMatrixDataType implemented

* implementing the last feedback ;)

* refactor

* hiding getArrayDataType from public API
2018-08-12 18:23:04 +02:00
jean-emmanuel
710ed1e58f Add support for single quotes strings 2018-08-04 10:27:10 +02:00
jos
eff54bd069 Refactored globalOptions into passing argument options everywhere (see #1173) 2018-08-03 16:34:07 +02:00
jos
e296fdcfe6 Refactored globalOptions into argument options everywhere (see #1173) 2018-08-03 16:32:42 +02:00
jos
391ce47eb3 Describe options in simplify docs (see #1173). Updated history.md. 2018-08-03 16:10:24 +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 de Jong
d711cb1132
Fixed a typo in an example 2018-07-28 16:57:05 +02:00
jos
9c3400684a Released v5.0.4 2018-07-22 17:47:40 +02:00
Honeybar
9b51a34dbe Speed up reshaping function of a matrix (#1177)
* Speed up reshaping function

* remove dimension error comment
2018-07-19 21:41:07 +02:00
Jos de Jong
6abe31803e
Insert zero width white spaces to prevent the table from getting too wide (see #1176) 2018-07-19 21:11:45 +02:00
Honeybar
a13f0ca7c6
style fix 2018-07-15 11:54:11 -07:00
Honeybar
4fb547cb7e
Delete productrange.js 2018-07-15 11:48:34 -07:00
Honeybar
f27ed3bb28
style fix 2018-07-15 11:47:38 -07:00
Honeybar
9ae26197c8
change filename and optimizing division by 2 2018-07-15 11:43:16 -07:00
Honeybar
45fde8b348
style fix 2018-07-15 00:35:44 -07:00
Honeybar
126bfbff6b
improving speed of factorial function 2018-07-14 23:40:12 -07:00
Honeybar
996922c46e
remove productBig function 2018-07-14 21:19:15 -07:00
Honeybar
77bd559b19
improving factorial function
speed up factorial function for number
2018-07-14 21:17:05 -07:00
Honeybar
3d35d858b8
improving factorial function
improving speed of bignumber and number
2018-07-14 20:35:32 -07:00
Honeybar
16ed3b8820
Improving factorial function
use divide and conquer to improve factorial for both number and bignumber
2018-07-14 19:43:19 -07:00
jos
f81f6f3f69 Released v5.0.3 2018-07-14 11:29:28 +02:00
jos
b29e83dcac Updated docs and history (see #1147, #1163) 2018-07-14 11:16:11 +02:00
Jos de Jong
c7e639c806
Merge pull request #1163 from ericman314/develop
Bug fix for engineering mode and precision
2018-07-14 11:10:22 +02:00
jos
8e18a2bd0a Document rationalize in the Algebra section of the docs 2018-07-14 11:06:11 +02:00
Ben Weinshel
650cf86006 change decimaljs to use es6 version 2018-07-13 14:00:28 -05:00
Eric Mansfield
630fe1162f Fixed lint problems 2018-07-10 21:28:17 -06:00
Eric Mansfield
fe6593a724 Bug fix for engineering mode and precision 2018-07-10 21:13:23 -06:00
jos
6ac8807854 Fixed #1162: transform functions not being cleaned up when overriding it by importing a factory function with the same name 2018-07-10 22:42:07 +02:00
jos
b44ce1477a Fixed many functions (for example add and subtract) not working with matrices having a datatype defined 2018-07-08 21:11:41 +02:00
jos
6301801145 Add benchmark to test numeric matrices vs generic matrices 2018-07-08 20:54:10 +02:00
Jos de Jong
00cacbce6d
Merge pull request #1157 from josdejong/parsin
Improve management of state in parse.js
2018-07-08 15:04:28 +02:00
Daniel Kostro
4e7bf85fbc docs: add link to lup in qr 2018-07-08 14:33:21 +02:00
Harry Sarson
f2f6a3c9c2
remove c from parsing state
`state.c` is always equal to `state.expression.charAt(state.index)`.
Therefore, the property `c` does not need to be included in the state.
This commit replaces all occurances of `state.c` with `currentCharacter(state)`.

This commit adds two functions:
  - `currentCharacter` replaces `state.c`
  - `currentString` which returns a substring starting at the current character.
2018-07-08 12:51:46 +01:00
Harry Sarson
e83c5be8ff
rename functions that peak at characters
Rename `nextPreview` and `prevPreview` to `nextCharacter` and `prevCharacter`
respectively so that these function names reflect the purpose of these functions.
2018-07-08 12:51:46 +01:00
Harry Sarson
85f012837b
remove function first
`first()` reset the state to an initial value.
Now parse no longer uses global variables this is not needed any more.
2018-07-08 12:51:45 +01:00
Harry Sarson
e596ab4992
pass state as a parameter to each function
This commit entirely removes the global state from `parse`.
The state is passed as an object to each function, functions modify the state passed to them.
2018-07-08 12:51:45 +01:00
Harry Sarson
223bab67de
remove global tokenStates
This global variable was only used in `parseRule2` so was removed from the global scope and added
to this function instead.
2018-07-08 12:51:45 +01:00
Harry Sarson
f8a917113a
combine global pass state into a couple of objects
Combines most of the global state used when passing expressions into an object called `state`.
This makes it easier to refactor this code going forward and clarifies which functions touch the global state.

`tokenStates` is still a seperate global variable which now contains copies of the state.
2018-07-08 12:51:13 +01:00
Daniel Kostro
f396f2d3fa fix some broken links 2018-07-08 10:08:32 +02:00
jos
575346d71e Updated history 2018-07-07 13:08:49 +02:00
jos
1c0bc02c85 Merge branch 'enable-constants-without-complex' of https://github.com/ChristopherChudzicki/mathjs into ChristopherChudzicki-enable-constants-without-complex
# Conflicts:
#	package-lock.json
2018-07-07 12:48:18 +02:00
jos
c3827d7411 Fixed #1137: simplify unnecessarily replacing implicit multiplication with explicit multiplication 2018-07-06 22:17:43 +02:00