295 Commits

Author SHA1 Message Date
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
jos
a9b9ed029e Merge branch 'develop' into fix/simplify_implicit_multiplication 2018-07-06 21:00:40 +02:00
jos
995c4fbb65 Make linter happy 2018-07-04 21:10:57 +02:00
jos
0d93fff878 Fixed #1146: rationalize throwing exceptions for some input with decimals 2018-07-04 21:06:55 +02:00
jos
f6f7bd2b25 Fixed #1088: function arguments not being passed to rawArgs functions 2018-07-04 14:05:07 +02:00
jos
3ee6201981 Fixed advanced example add_new_datatypes, upgraded dependencies 2018-07-04 12:26:38 +02:00
Chris Chudzicki
356aca494b enable bundling constants without complex 2018-07-03 22:58:37 -04:00
jos
4052d59fea Release v5.0.1 2018-07-01 15:17:19 +02:00
jos
06dda6fc95 Fix keeping implicit multiplication in simplify (WIP) 2018-07-01 15:10:43 +02:00
gap
d15498715d Improve debugging support
When this error is encountered in the field, I see it via honeybadger, but I have none of the context about what unit it was called in, and what unit it was being converted to. Help the debugging by adding some info to the exception. I'm not entirely sure that 'toString' is what I want here - perhaps others in the community can help make that the right expression?
2018-06-16 14:22:21 -05:00
jos
f0e5ed5774 Released v5.0.0 2018-06-16 15:12:57 +02:00
ssaket
886b291fc3 modified the error log 2018-06-14 22:53:51 +05:30