1723 Commits

Author SHA1 Message Date
jos
b9175a1a29 Fixed IndexNode using a hardcoded, one-based implementation of index. See #782 2019-11-20 12:23:06 +01:00
Harry Sarson
462f46947f fix qr and sign edge cases (#1670)
* fix qr and sign edge cases

qr() was throwing an error if the pivots of a matrix were zero.
This commit fixes that and ensures that the results are consistant
with wolfram alpha.

Whilst doing this I found a bug in complex.js, I have added a work
around but we should flag this upstream.

I also addressed the long standing concerns about assert statements
within the body of the qr function.

Fixes #1669
Fixes #942

* further improvements to qr and sign

mainly fixing things I got wrong in previous commit

* add array test

* fix: remove only from tests and disallow

Uses mochas `--forbid-only` flag as advised by
https://github.com/standard/standard/issues/988
2019-11-18 20:03:09 +01:00
jos
3526f651bf Add small benchmark for primes (see #1641) 2019-10-06 10:41:37 +02:00
Clinton Curry
69dd165afb Allow taking means of quantities with units. (#1644)
* Allow taking means of quantities with units.

* Fix silly error in test.

The test as written did not test anything about units.

* Fix same error again...
2019-10-03 20:28:25 +02:00
jos
7b1cd7753e Fixed #1628: Cannot call methods on empty strings or numbers with value 0 2019-09-23 20:23:39 +02:00
Rian McGuire
a8d94cbbeb Copy IndexNode dotNotation property in map and clone methods (#1623)
* Copy dotNotation in IndexNode.prototype.map

* Copy dotNotation in IndexNode.prototype.clone
2019-09-20 20:11:18 +02:00
jos
e37cc81735 Fixed #1606: function format not working for expressions 2019-08-29 10:17:57 +02:00
Waseem Yusuf
c0e87c4b71 Make combinationsWithRep.js more efficient (#1602)
* Implemented the `multicombinations` function

* Write unit tests for `multicombinations` function

* Integrate the `multicombinations` function throughout codebase

1. Include multicombinations factory function in factoriesAny.js and factoriesNumber.js
2. Write embedded docs for multicombinations
3. Added latex support
4. Refer to multicombinations in the "see also"-section of related functions

* Change name from `multichoose` to `combinationsWithRep`

* Update combinationsWithRep.js

Instead of always cancelling `n-1 factorial` from the denominator and ignoring `k factorial`, added a conditional to cancel the the larger of the two, therefore further reducing redundant calculations.

* Revert "Update combinationsWithRep.js"

This reverts commit efef6d3bd4c381aa12f00869a7624a622268805c.

* Update combinationsWithRep.js

Instead of always cancelling `n-1 factorial` from the denominator and ignoring `k factorial`, added a conditional to cancel the the larger of the two, therefore further reducing redundant calculations.

* Add one more test for the case: k > n-1

* Refactor single for-loop into two separate ones
2019-08-28 15:10:24 +02:00
Harry Sarson
e0adfb3e37 Ignore use of template literals in normal strings for latex
Mathjs latex uses same syntax as template literals, thus we need to
ignore some otherwise helpful rules that look for template literal
syntax in normal strings.
2019-08-21 10:09:10 +01:00
Harry Sarson
b6a42c032d run standard --fix 2019-08-21 10:09:10 +01:00
Waseem Yusuf
4cee37232f Added a combinationsWithRep function to calculate combinations with repitition (#1588)
* Implemented the `multicombinations` function

* Write unit tests for `multicombinations` function

* Integrate the `multicombinations` function throughout codebase

1. Include multicombinations factory function in factoriesAny.js and factoriesNumber.js
2. Write embedded docs for multicombinations
3. Added latex support
4. Refer to multicombinations in the "see also"-section of related functions

* Change name from `multichoose` to `combinationsWithRep`
2019-08-15 11:35:51 +02:00
jos
202cecc39a Fix generated files not compiled into ./es folder 2019-08-05 22:08:57 +02:00
jos
9991449ce0 Generate ESModules transpiled to ES5 2019-08-05 21:19:00 +02:00
jos
021485922a Fix broken unit test 2019-07-20 14:14:33 +02:00
jos
d8a4f3a00a Update to standard@13.0.2 2019-07-20 13:46:31 +02:00
jos
deb7c05b53 Fix #1550: nested user defined function not receiving variables of an outer user defined function 2019-07-07 10:56:01 +02:00
jos
c147d54435 Fix not being able to set configuration after disabling function import 2019-06-11 20:40:07 +02:00
jos
bce068e601 Update browser versions tested against with BrowserStack 2019-06-05 11:50:32 +02:00
jos
db4910bed4 Move all test related stuff in folder test 2019-06-05 11:45:02 +02:00
jos
35fc780d2a Refactor import to first flatten the functions and then import them, allowing to import dependency collections 2019-06-05 10:57:48 +02:00
jos
41efed79d3 Fix #1473: remove 'use strict' in every file 2019-05-26 20:21:18 +02:00
jos
f54599a701 Fix #1530: apply rounding first and lowerExp and upperExp second when formatting a number 2019-05-25 15:51:33 +02:00
jos
45344e8d9e Fix another round-off error in unit tests of in units on IE/Edge 2019-05-25 15:29:52 +02:00
jos
9a6c79afe8 Fix round-off error in constant reducedPlanck on IE and Edge 2019-05-25 15:12:16 +02:00
Eric Mansfield
c08188b8ed Updated physical constants to 2019 recommended values (#1529) 2019-05-25 14:48:37 +02:00
jos
859cac81a1 Merged function core and create into one function create 2019-05-22 21:20:56 +02:00
Vlad Levitskiy
538823386a deleted decibel unit (#1524) 2019-05-22 17:06:19 +02:00
jos
e5048a8001 Allow math.import(all). Dropped support for renaming factory functions 2019-05-22 13:49:56 +02:00
Vlad Levitskiy
3516731ff6 Fixed tonne and candela units, added bel and dB (#1518)
* fixed tonne and candel units, added bel and dB

* fixed code style
2019-05-20 20:41:10 +02:00
jos
28e33bb89b Merge remote-tracking branch 'origin/v5' into develop
# Conflicts:
#	package-lock.json
#	package.json
2019-05-17 19:44:25 +02:00
Eric Mansfield
ce77993689 Added some additional tests for engineering format 2019-05-16 23:01:33 -06:00
jos
0a6aded52a Fix #1512: bug in format notation engineering 2019-05-16 21:51:13 +02:00
jos
3e553e1d11 Remove dependency on matrix of function random 2019-05-15 17:54:39 +02:00
jos
6b6ae1383c Dropped fake BigNumber support from function erf 2019-05-15 10:54:02 +02:00
jos
ab1b83a2f6 Remove generated files from repo, make tests independent from generated files 2019-05-12 15:14:13 +02:00
jos
9950857a87 Fix lint error 2019-05-08 22:25:37 +02:00
Harry Sarson
6fe56d5471 Drop node 6 (#1494)
* Drop node 6

node 6 is no longer support by node. Also add node 12 to CI.

* add test for high precision sin
2019-05-08 22:22:05 +02:00
jos
4135467ef3 Fix broken unit test 2019-05-08 11:36:02 +02:00
jos
c0a11b3d88 Auto generate impureFunctionsAny files 2019-05-08 11:33:51 +02:00
jos
3f63d6e9f5 Remove outdated README in /test (see #1498) 2019-05-05 09:42:53 +02:00
jos
cc740b39be Move snapshot code into /src to have it transpiled 2019-05-04 15:17:15 +02:00
jos
5b7928d284 Fix using endsWith method 2019-05-04 14:52:33 +02:00
jos
47e1adcd0e Dynamically generate the expected snapshot structure based on the factories 2019-05-04 14:39:30 +02:00
jos
b4f2eb005e Merge remote-tracking branch 'origin/fix/1428' into develop
# Conflicts:
#	HISTORY.md
#	src/function/algebra/simplify.js
2019-05-04 10:07:39 +02:00
jos
c7b3ea9c7e Fix chain 2019-04-30 20:49:45 +02:00
jos
20aa9a005a Fix circular dependency in math namespace for evaluate 2019-04-29 21:19:50 +02:00
jos
427c39c33b Created ES5 and ES6 entry points 2019-04-28 20:56:08 +02:00
jos
bb9a1e2164 Rename *Full files to *Any 2019-04-27 20:27:26 +02:00
jos
2450ed1fc1 Update entry files and snapshots with latest merged functions 2019-04-24 11:05:39 +02:00
jos
f4d4180cea Move all entry files under ./src/entry 2019-04-24 10:48:01 +02:00