51 Commits

Author SHA1 Message Date
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
c3827d7411 Fixed #1137: simplify unnecessarily replacing implicit multiplication with explicit multiplication 2018-07-06 22:17:43 +02:00
jos
06dda6fc95 Fix keeping implicit multiplication in simplify (WIP) 2018-07-01 15:10:43 +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
024b2a9e26 Fix most lint errors using npx standard --fix 2018-06-10 20:28:27 +02: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
99ab11b234 Dropped constant uninitialized 2018-02-04 13:09:09 +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
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
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
firepick1 (localhost)
c765f3dcca #958 exponent power rule 2017-10-21 19:23:21 -04:00
Ivan Vergiliev
9dde07ed11 Simplify nested exponentiations 2017-10-17 08:15:22 -07:00
jos
e033697001 Add unit tests against infinite recursive loops in simplify 2017-10-01 20:26:30 +02:00
firepick1 (localhost)
5b175d56a5 #934 unaryMinus simplifyCore 2017-08-28 06:35:40 -07:00
firepick1 (localhost)
4787237b31 #933 +unaryMinus to subtract 2017-08-24 20:18:06 -07:00
firepick1 (localhost)
827ab5dc28 Merge branch 'develop' into simplify2 2017-08-24 19:56:35 -07:00
firepick1 (localhost)
52e29d6456 925 simplify(string, Array, Object) 2017-08-18 17:30:48 -07:00
jos
a18f2068f3 Fixed toString of a parsed expression tree containing an immediately invoked function assignment not being wrapped in parenthesis 2017-08-12 11:03:19 +02:00
jos
54230e8dc9 Fixed #916 handle dynamic function calls in simplify 2017-08-12 10:39:51 +02:00
firepick1 (localhost)
dccec26cb1 #916 simplifyCore loses custom functions 2017-08-08 20:48:24 -07:00
jos
1f2d4f3296 Replaced another occurrence of ES6 backtick 2017-08-06 12:00:51 +02:00
firepick1 (localhost)
53e64ee18d resolve scope Node values 2017-08-02 13:39:55 -07:00
firepick1 (localhost)
709f1bc075 #907 simplify.resolve 2017-08-02 07:30:00 -07:00
firepick1 (localhost)
bd870d3545 simplifyCore() performance improvement 2017-08-01 11:45:06 -07:00
Jos de Jong
71221b75df Merge pull request #840 from tetslee/fix838
Fixed simplify to recognize named constants
2017-05-09 20:12:28 +02:00
Timothy Lee
02f01adf3c Added support for BigNumbers to simplify 2017-05-09 13:20:32 +09:30
Timothy Lee
6f2b5efaac Disallow implicitly converting a number to a fraction that is not an exact representation 2017-05-08 15:58:06 +09:30
Timothy Lee
82095ebc19 Revert "Changed multiply to only output Fractions when both arguments can be exactly represented as Fractions"
This reverts commit f3cb41864582b2dc8b07c07d4c22d6c313bcc114.
2017-05-08 15:57:19 +09:30
Timothy Lee
158adc1861 Added support for more constants in simplify 2017-05-08 12:56:56 +09:30
Timothy Lee
f3cb418645 Changed multiply to only output Fractions when both arguments can be exactly represented as Fractions 2017-05-05 16:30:37 +09:30
Timothy Lee
c47dee1d01 Stopped simplify from explicitly converting numbers to Fractions when they can't be expressed exactly.
It still will implicitly convert to inexact Fractions because of the conversions to Fractions in the typed-functions of binary operators.
2017-05-05 14:54:04 +09:30
Timothy Lee
9e2491e96f Fixed simplify to recognize named constants 2017-05-05 13:44:21 +09:30
tim
613e7012a1 simplify - remove addtion of zero 2017-04-13 19:06:39 +09:30
jos
d722473b53 Fixed simplify not handling non-existing functions correctly 2017-01-22 15:44:14 +01:00
jos
f4b7855a84 Docs, examples, some fixes 2017-01-22 15:30:18 +01:00
jos
db67f4cb84 Removed method Node.simplify() (use function simplify instead) 2017-01-22 13:42:19 +01:00
jos
0ae4dce80b Updated docs of simplify and derivative 2017-01-21 20:29:10 +01:00
jos
71ae3ea076 Consistent API for both derivative and simplify (dropped transform) 2017-01-20 21:43:40 +01:00
tetslee
5a75a8c222 Simplify terms and factors seperated by inverse operators.
The simplify algorithm now applies rules one at a time.
2016-11-07 11:20:28 +10:30
tetslee
23bf1031eb Improved constant folding in simplify. 2016-11-04 18:02:42 +10:30