mathjs 9.4.0 → 9.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HISTORY.md +39 -0
- package/README.md +1 -3
- package/docs/expressions/expression_trees.md +2 -1
- package/docs/expressions/parsing.md +1 -1
- package/docs/reference/functions/intersect.md +1 -1
- package/examples/advanced/custom_datatype.js +7 -4
- package/lib/browser/math.js +7 -7
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js +6 -9
- package/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js +3 -0
- package/lib/cjs/entry/impureFunctionsAny.generated.js +41 -41
- package/lib/cjs/entry/pureFunctionsAny.generated.js +128 -128
- package/lib/cjs/expression/node/ArrayNode.js +15 -15
- package/lib/cjs/expression/parse.js +1 -0
- package/lib/cjs/function/geometry/intersect.js +93 -58
- package/lib/cjs/function/matrix/eigs/complexEigs.js +168 -18
- package/lib/cjs/function/matrix/eigs.js +7 -9
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/type/bignumber/BigNumber.js +3 -3
- package/lib/cjs/utils/is.js +13 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js +4 -6
- package/lib/esm/entry/dependenciesAny/dependenciesIntersect.generated.js +2 -0
- package/lib/esm/entry/impureFunctionsAny.generated.js +38 -38
- package/lib/esm/entry/pureFunctionsAny.generated.js +107 -107
- package/lib/esm/expression/node/ArrayNode.js +16 -16
- package/lib/esm/expression/parse.js +1 -0
- package/lib/esm/function/geometry/intersect.js +91 -58
- package/lib/esm/function/matrix/eigs/complexEigs.js +152 -18
- package/lib/esm/function/matrix/eigs.js +7 -9
- package/lib/esm/type/bignumber/BigNumber.js +2 -3
- package/lib/esm/utils/is.js +13 -1
- package/lib/esm/version.js +1 -1
- package/package.json +22 -20
- package/types/index.d.ts +4772 -0
- package/types/index.ts +597 -0
- package/types/tsconfig.json +18 -0
- package/types/tslint.json +6 -0
    
        package/HISTORY.md
    CHANGED
    
    | @@ -1,5 +1,44 @@ | |
| 1 1 | 
             
            # History
         | 
| 2 2 |  | 
| 3 | 
            +
            # 2021-07-07, version 9.4.4
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            - Fixed `ArrayNode.toTex()`: remove the row delimiter on the last row, 
         | 
| 6 | 
            +
              see #2267. Thanks @davidtranhq.
         | 
| 7 | 
            +
            - Fix #2269: `intersect`  not returning `null` for matrix input. Thanks @m93a.
         | 
| 8 | 
            +
            - Fix #2245: mathjs not working in IE11 anymore due to a missing polyfill for
         | 
| 9 | 
            +
              `Symbol`. The browser bundle now includes the necessary polyfills (it is 
         | 
| 10 | 
            +
              larger now because of that, see also #2266). Thanks @m93a.
         | 
| 11 | 
            +
            - Update dependencies (`complex.js@2.0.15`, `decimal.js@10.3.1`)
         | 
| 12 | 
            +
            - Drop official support for node.js 10, which has reached end of life. 
         | 
| 13 | 
            +
              See #2258.
         | 
| 14 | 
            +
             | 
| 15 | 
            +
             | 
| 16 | 
            +
            # 2021-06-23, version 9.4.3
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            - Fix #2222: mathjs polluting the `Decimal` prototype. Thanks @m93a.
         | 
| 19 | 
            +
            - Fix #2253: expression parser throwing an error when accessing nested object
         | 
| 20 | 
            +
              properties named `e`.
         | 
| 21 | 
            +
            - Fixes in TypeScript definitions fo:
         | 
| 22 | 
            +
              - function `floor`, #2159, #2246. Thanks @write2kcl.
         | 
| 23 | 
            +
              - function `simplify`, see #2252. Thanks @nitroin. 
         | 
| 24 | 
            +
            - Upgraded to `decimal.js@10.3.0`
         | 
| 25 | 
            +
             | 
| 26 | 
            +
             | 
| 27 | 
            +
            # 2021-06-05, version 9.4.2
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            - Implemented iterative eigenvalue finder for `eigs`, making it much more 
         | 
| 30 | 
            +
              robust. See #2179, #2237. Thanks @m93a.
         | 
| 31 | 
            +
            - Improved TypeScript definitions of function `parse`. Thanks @OpportunityLiu.
         | 
| 32 | 
            +
             | 
| 33 | 
            +
             | 
| 34 | 
            +
            # 2021-05-24, version 9.4.1
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            - Fix #2100: add TypeScript declaration for `eigs`. Thanks @andrebianchessi.
         | 
| 37 | 
            +
            - Fix #2220: add TypeScript files to published npm package. Thanks @dhritzkiv.
         | 
| 38 | 
            +
            - Update readme regarding TypeScript definition files. Thanks @dhritzkiv.
         | 
| 39 | 
            +
            - Update to `fraction.js@4.1.1`
         | 
| 40 | 
            +
             | 
| 41 | 
            +
             | 
| 3 42 | 
             
            # 2021-05-16, version 9.4.0
         | 
| 4 43 |  | 
| 5 44 | 
             
            - Implemented support to use objects with a `Map` interface as scope, 
         | 
    
        package/README.md
    CHANGED
    
    | @@ -33,8 +33,6 @@ Install math.js using [npm](https://www.npmjs.com/package/mathjs): | |
| 33 33 |  | 
| 34 34 | 
             
                npm install mathjs
         | 
| 35 35 |  | 
| 36 | 
            -
            > Note that when using mathjs in a TypeScript project, you will have to install type definition files too: `npm install @types/mathjs`.
         | 
| 37 | 
            -
             | 
| 38 36 | 
             
            Or download mathjs via one of the CDN's listed on the downloads page:
         | 
| 39 37 |  | 
| 40 38 | 
             
                [https://mathjs.org/download.html](https://mathjs.org/download.html#download)
         | 
| @@ -168,7 +166,7 @@ To see the coverage results, open the generated report in your browser: | |
| 168 166 |  | 
| 169 167 | 
             
            ### Continuous integration testing
         | 
| 170 168 |  | 
| 171 | 
            -
            Continuous integration tests are run on [Github Actions](https://github.com/josdejong/mathjs/actions) and [BrowserStack](https://www.browserstack.com) every time a commit is pushed to github. Github Actions runs the tests for different versions of node.js, and BrowserStack runs the tests  | 
| 169 | 
            +
            Continuous integration tests are run on [Github Actions](https://github.com/josdejong/mathjs/actions) and [BrowserStack](https://www.browserstack.com) every time a commit is pushed to github. Github Actions runs the tests for different versions of node.js, and BrowserStack runs the tests on all major browsers.
         | 
| 172 170 |  | 
| 173 171 | 
             
            [](https://www.browserstack.com)
         | 
| 174 172 |  | 
| @@ -554,7 +554,7 @@ const node2 = new math.ObjectNode({a: a, b: b, c: c}) | |
| 554 554 | 
             
            Construction:
         | 
| 555 555 |  | 
| 556 556 | 
             
            ```
         | 
| 557 | 
            -
            new OperatorNode(op: string, fn: string, args: Node[])
         | 
| 557 | 
            +
            new OperatorNode(op: string, fn: string, args: Node[], implicit: boolean = false)
         | 
| 558 558 | 
             
            ```
         | 
| 559 559 |  | 
| 560 560 | 
             
            Additional methods:
         | 
| @@ -587,6 +587,7 @@ Properties: | |
| 587 587 | 
             
            - `op: string`
         | 
| 588 588 | 
             
            - `fn: string`
         | 
| 589 589 | 
             
            - `args: Node[]`
         | 
| 590 | 
            +
            - `implicit: boolean` True in case of an implicit multiplication, false otherwise
         | 
| 590 591 |  | 
| 591 592 | 
             
            Examples:
         | 
| 592 593 |  | 
| @@ -221,4 +221,4 @@ Some care is taken to mutate the same object that is passed into mathjs, so they | |
| 221 221 |  | 
| 222 222 | 
             
            For less reliance on this blacklist, scope can also be a `Map`, which allows mathjs expressions to define variables and functions of any name.
         | 
| 223 223 |  | 
| 224 | 
            -
            For more, see [examples of custom scopes] | 
| 224 | 
            +
            For more, see [examples of custom scopes](../../examples/advanced/custom_scope_objects.js).
         | 
| @@ -24,7 +24,7 @@ Parameter | Type | Description | |
| 24 24 | 
             
            `w` | Array | Matrix | Co-ordinates of first end-point of first line
         | 
| 25 25 | 
             
            `x` | Array | Matrix | Co-ordinates of second end-point of first line
         | 
| 26 26 | 
             
            `y` | Array | Matrix | Co-ordinates of first end-point of second line OR Co-efficients of the plane's equation
         | 
| 27 | 
            -
            `z` | Array | Matrix | Co-ordinates of second end-point of second line OR  | 
| 27 | 
            +
            `z` | Array | Matrix | Co-ordinates of second end-point of second line OR undefined if the calculation is for line and plane
         | 
| 28 28 |  | 
| 29 29 | 
             
            ### Returns
         | 
| 30 30 |  | 
| @@ -46,8 +46,11 @@ math.import([ | |
| 46 46 | 
             
            ])
         | 
| 47 47 |  | 
| 48 48 | 
             
            // use the new type
         | 
| 49 | 
            -
            const  | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
            console.log(ans.toString())
         | 
| 49 | 
            +
            const ans1 = math.add(new math.CustomValue(2), new math.CustomValue(3))
         | 
| 50 | 
            +
            console.log(ans1.toString())
         | 
| 53 51 | 
             
            // outputs 'CustomValue:5'
         | 
| 52 | 
            +
             | 
| 53 | 
            +
            // you can automatically use the new type in functions which use `add` under the hood:
         | 
| 54 | 
            +
            const ans2 = math.sum(new math.CustomValue(6), new math.CustomValue(1), new math.CustomValue(2))
         | 
| 55 | 
            +
            console.log(ans2.toString())
         | 
| 56 | 
            +
            // outputs 'CustomValue:9'
         |