diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c468dee3..4478db6a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ ideas and suggestions, and contribute to the code. There are a few preferences regarding code contributions: -- The code of math.js follows the JavaScript Standard Style as described on http://standardjs.com/. +- The code of math.js follows the JavaScript Standard Style as described on https://standardjs.com/. - Make sure you properly unit test your changes. - Before creating a pull request, run the unit tests to make sure they all pass. - Only commit changes done in the source files under `src`, not to the generated builds @@ -15,9 +15,9 @@ There are a few preferences regarding code contributions: What can I do? -- Search through the [issues](https://github.com/josdejong/mathjs/issues) looking - for something that looks interesting to you to pick up. Some issues are marked - ["help wanted"](https://github.com/josdejong/mathjs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22), +- Search through the [issues](https://github.com/josdejong/mathjs/issues) looking + for something that looks interesting to you to pick up. Some issues are marked + ["help wanted"](https://github.com/josdejong/mathjs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22), these are typically issues which should be relatively easy to pick up. Thanks! diff --git a/HISTORY.md b/HISTORY.md index 19a5d18e2..16590616c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,12 @@ # History +# Not yet published, version 5.6.0 + +- Upgrade decimal.js to v10.1.0 (#1421). +- Fixed #1418: missing whitespace when stringifying an expression + containing "not". + + # 2019-02-20, version 5.5.0 - Fixed #1401: methods `map` and `forEach` of `SparseMatrix` not working diff --git a/LICENSE b/LICENSE index ea2712c09..9cf8c11d8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION diff --git a/NOTICE b/NOTICE index 1d7847ad9..b054d04c7 100644 --- a/NOTICE +++ b/NOTICE @@ -7,7 +7,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/README.md b/README.md index 7a03e2546..cc3a18c63 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@  -[http://mathjs.org](http://mathjs.org) +[https://mathjs.org](https://mathjs.org) Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices. Powerful and easy to use. @@ -8,7 +8,7 @@ Math.js is an extensive math library for JavaScript and Node.js. It features a f [](https://www.npmjs.com/package/mathjs) [](https://travis-ci.org/josdejong/mathjs) [](https://greenkeeper.io/) -[](https://github.com/josdejong/mathjs/graphs/commit-activity) +[](https://github.com/josdejong/mathjs/graphs/commit-activity) [](https://github.com/josdejong/mathjs/blob/master/LICENSE) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs?ref=badge_shield) [](https://slack.bri.im) @@ -37,13 +37,13 @@ Install math.js using [npm](https://www.npmjs.com/package/mathjs): Or download mathjs via one of the CDN's listed on the downloads page: - [http://mathjs.org/download.html](http://mathjs.org/download.html#download) + [https://mathjs.org/download.html](https://mathjs.org/download.html#download) Math.js can be used similar to JavaScript's built-in Math library. Besides that, math.js can evaluate -[expressions](http://mathjs.org/docs/expressions/index.html) +[expressions](https://mathjs.org/docs/expressions/index.html) and supports -[chained operations](http://mathjs.org/docs/core/chaining.html). +[chained operations](https://mathjs.org/docs/core/chaining.html). ```js // load math.js @@ -71,7 +71,7 @@ math.chain(3) .done() // 14 ``` -See the [Getting Started](http://mathjs.org/docs/getting_started.html) for a more detailed tutorial. +See the [Getting Started](https://mathjs.org/docs/getting_started.html) for a more detailed tutorial. ## Browser support @@ -84,10 +84,10 @@ when using the [es5-shim](https://github.com/kriskowal/es5-shim). ## Documentation -- [Getting Started](http://mathjs.org/docs/getting_started.html) -- [Examples](http://mathjs.org/examples/index.html) -- [Overview](http://mathjs.org/docs/index.html) -- [History](http://mathjs.org/history.html) +- [Getting Started](https://mathjs.org/docs/getting_started.html) +- [Examples](https://mathjs.org/examples/index.html) +- [Overview](https://mathjs.org/docs/index.html) +- [History](https://mathjs.org/history.html) ## Build @@ -154,7 +154,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/bin/cli.js b/bin/cli.js index d1e02965e..80736fdbf 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -36,7 +36,7 @@ * use this file except in compliance with the License. You may obtain a copy * of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT @@ -323,7 +323,7 @@ function outputVersion () { */ function outputHelp () { console.log('math.js') - console.log('http://mathjs.org') + console.log('https://mathjs.org') console.log() console.log('Math.js is an extensive math library for JavaScript and Node.js. It features ') console.log('real and complex numbers, units, matrices, a large set of mathematical') diff --git a/composer.json b/composer.json index ebac137bb..b30a11cbb 100644 --- a/composer.json +++ b/composer.json @@ -2,12 +2,12 @@ "name": "components/mathjs", "description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.", "type": "component", - "homepage": "http://mathjs.org", + "homepage": "https://mathjs.org", "license": "Apache-2.0", "support": { "issues": "https://github.com/josdejong/mathjs/issues", "source": "https://github.com/josdejong/mathjs/", - "docs": "http://mathjs.org/docs" + "docs": "https://mathjs.org/docs" }, "authors": [ { diff --git a/docs/core/extension.md b/docs/core/extension.md index 7ca77e98c..cd649a873 100644 --- a/docs/core/extension.md +++ b/docs/core/extension.md @@ -56,7 +56,7 @@ parser.eval('hello("user")') // 'hello, user!' External libraries like [numbers.js](https://github.com/sjkaliski/numbers.js) and -[numeric.js](http://numericjs.com/) can be imported as follows. +[numeric.js](https://github.com/sloisel/numeric) can be imported as follows. The libraries must be installed using npm: $ npm install numbers diff --git a/docs/datatypes/units.md b/docs/datatypes/units.md index cf09c9b01..b9e77e2c7 100644 --- a/docs/datatypes/units.md +++ b/docs/datatypes/units.md @@ -72,7 +72,7 @@ math.cos(c) // Number 0.7071067811865476 // Kinetic energy of average sedan on highway const d = math.unit('80 mi/h') // Unit 80 mi/h const e = math.unit('2 tonne') // Unit 2 tonne -const f = math.multiply(0.5, math.multipy(math.pow(d, 2), e)) +const f = math.multiply(0.5, math.multipy(math.pow(d, 2), e)) // 1.2790064742399996 MJ ``` @@ -111,7 +111,7 @@ units on the page [Syntax](../expressions/syntax.md#units). You can add your own units to Math.js using the `math.createUnit` function. The following example defines a new unit `furlong`, then uses the user-defined unit in a calculation: ```js -math.createUnit('furlong', '220 yards') +math.createUnit('furlong', '220 yards') math.eval('1 mile to furlong') // 8 furlong ``` @@ -119,7 +119,7 @@ If you cannot express the new unit in terms of any existing unit, then the secon ```js // A 'foo' cannot be expressed in terms of any other unit. -math.createUnit('foo') +math.createUnit('foo') math.eval('8 foo * 4 feet') // 32 foo feet ``` @@ -217,7 +217,7 @@ The type of the returned value is always `number`. ### unit.toNumeric(unitName) Get the value of a unit when converted to the specified unit (a unit with optional prefix but without value). -The type of the returned value depends on how the unit was created and +The type of the returned value depends on how the unit was created and can be `number`, `Fraction`, or `BigNumber`. ### unit.toSI() @@ -241,7 +241,7 @@ Length | meter (m), inch (in), foot (ft), yard (yd), mile (mi), lin Surface area | m2, sqin, sqft, sqyd, sqmi, sqrd, sqch, sqmil, acre, hectare Volume | m3, litre (l, L, lt, liter), cc, cuin, cuft, cuyd, teaspoon, tablespoon Liquid volume | minim (min), fluiddram (fldr), fluidounce (floz), gill (gi), cup (cp), pint (pt), quart (qt), gallon (gal), beerbarrel (bbl), oilbarrel (obl), hogshead, drop (gtt) -Angles | rad (radian), deg (degree), grad (gradian), cycle, arcsec (arcsecond), arcmin (arcminute) +Angles | rad (radian), deg (degree), grad (gradian), cycle, arcsec (arcsecond), arcmin (arcminute) Time | second (s, secs, seconds), minute (mins, minutes), hour (h, hr, hrs, hours), day (days), week (weeks), month (months), year (years), decade (decades), century (centuries), millennium (millennia) Frequency | hertz (Hz) Mass | gram(g), tonne, ton, grain (gr), dram (dr), ounce (oz), poundmass (lbm, lb, lbs), hundredweight (cwt), stick, stone @@ -258,7 +258,7 @@ Binary | bit (b), byte (B) Note: all time units are based on the Julian year, with one month being 1/12th of a Julian year, a year being one Julian year, a decade being 10 Julian years, a century being 100, and a millennium being 1000. -Note that all relevant units can also be written in plural form, for example `5 meters` instead of `5 meter` or `10 seconds` instead of `10 second`. +Note that all relevant units can also be written in plural form, for example `5 meters` instead of `5 meter` or `10 seconds` instead of `10 second`. Surface and volume units can alternatively be expressed in terms of length units raised to a power, for example `100 in^2` instead of `100 sqin`. @@ -320,7 +320,7 @@ yotta | Y | 1e24 ### Physical Constants -Math.js includes the following physical constants. See [Wikipedia](http://en.wikipedia.org/wiki/Physical_constants) for more information. +Math.js includes the following physical constants. See [Wikipedia](https://en.wikipedia.org/wiki/Physical_constants) for more information. #### Universal constants @@ -330,7 +330,7 @@ Name | Symbol | speedOfLight | c | 299792458 | m · s-1 gravitationConstant | G | 6.6738480e-11 | m3 · kg-1 · s-2 planckConstant | h | 6.626069311e-34 | J · s -reducedPlanckConstant | h | 1.05457172647e-34 | J · s +reducedPlanckConstant | h | 1.05457172647e-34 | J · s #### Electromagnetic constants @@ -350,7 +350,7 @@ nuclearMagneton | μN | 5 klitzing | RK | 25812.807443484 | Ω @@ -392,11 +392,11 @@ secondRadiation | c2 | 1.438777013e-2 | m stefanBoltzmann | σ | 5.67037321e-8 | W · m-2 · K-4 wienDisplacement | b | 2.897772126e-3 | m · K - -Note that the values of `loschmidt` and `molarVolume` are at `T = 273.15 K` and `p = 101.325 kPa`. +Note that the values of `loschmidt` and `molarVolume` are at `T = 273.15 K` and `p = 101.325 kPa`. The value of `sackurTetrode` is at `T = 1 K` and `p = 101.325 kPa`. @@ -415,7 +415,7 @@ atm | atm | 101325 | Pa Name | Symbol | Value | Unit ------------------|-----------------------|--------------------|----- planckLength | lP | 1.61619997e-35 | m -planckMass | mP | 2.1765113e-8 | kg +planckMass | mP | 2.1765113e-8 | kg planckTime | tP | 5.3910632e-44 | s planckCharge | qP | 1.87554595641e-18 | C -planckTemperature | TP | 1.41683385e+32 | K +planckTemperature | TP | 1.41683385e+32 | K diff --git a/docs/expressions/algebra.md b/docs/expressions/algebra.md index a76a11d4f..c6e2bf064 100644 --- a/docs/expressions/algebra.md +++ b/docs/expressions/algebra.md @@ -29,7 +29,7 @@ console.log(simplified.eval({x: 4})) // 12 For more details on the theory of expression simplification, see: -- [Strategies for simplifying math expressions (Stackoverflow)](http://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions) +- [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions) - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification) @@ -56,7 +56,7 @@ console.log(dh.eval({x: 3})) // '7' The rules used by `math.derivative` can be found on Wikipedia: -- [Differentiation rules (Wikipedia)](http://en.wikipedia.org/wiki/Differentiation_rules) +- [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules) ## Rationalize diff --git a/docs/expressions/expression_trees.md b/docs/expressions/expression_trees.md index ce4a91b6c..a62a9ee0b 100644 --- a/docs/expressions/expression_trees.md +++ b/docs/expressions/expression_trees.md @@ -168,7 +168,7 @@ All nodes have the following methods: - `toTex(options: object): string` - Get a [LaTeX](http://en.wikipedia.org/wiki/LaTeX) representation of the + Get a [LaTeX](https://en.wikipedia.org/wiki/LaTeX) representation of the expression. Example: ```js diff --git a/docs/expressions/parsing.md b/docs/expressions/parsing.md index 0d0c88d61..15a1f8df8 100644 --- a/docs/expressions/parsing.md +++ b/docs/expressions/parsing.md @@ -134,7 +134,7 @@ code2.eval(scope) // 27 Parsed expressions can be exported to text using `node.toString()`, and can be exported to LaTeX using `node.toTex()`. The LaTeX export can be used to pretty print an expression in the browser with a library like -[MathJax](http://www.mathjax.org/). Example usage: +[MathJax](https://www.mathjax.org/). Example usage: ```js // parse an expression diff --git a/docs/getting_started.md b/docs/getting_started.md index 799797786..c11838873 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -5,13 +5,13 @@ This getting started describes how to install, load, and use math.js. ## Install -Math.js can be installed using various package managers like [npm](https://npmjs.org/), or by just downloading the library from the website: [http://mathjs.org/download.html](http://mathjs.org/download.html). +Math.js can be installed using various package managers like [npm](https://npmjs.org/), or by just downloading the library from the website: [https://mathjs.org/download.html](https://mathjs.org/download.html). To install via npm, run: npm install mathjs -Other ways to install math.js are described on the [website](http://mathjs.org/download.html). +Other ways to install math.js are described on the [website](https://mathjs.org/download.html). ## Load @@ -35,7 +35,7 @@ math.sqrt(-4) // 2i ### Node.js -Load math.js in [node.js](http://nodejs.org/): +Load math.js in [node.js](https://nodejs.org/): ```js // load math.js @@ -73,7 +73,7 @@ as well. ### Require.js -Load math.js in the browser using [require.js](http://requirejs.org/): +Load math.js in the browser using [require.js](https://requirejs.org/): ```js require.config({ @@ -94,7 +94,7 @@ math.js can evaluate expressions (see [Expressions](expressions/index.md)) and supports chaining (see [Chaining](core/chaining.md)). The example code below shows how to use math.js. More examples can be found in the -section [Examples](http://mathjs.org/examples/index.html). +section [Examples](https://mathjs.org/examples/index.html). ```js // functions and constants @@ -123,4 +123,4 @@ math.chain(3) To learn more about math.js, check out the available documentation and examples: - [Documentation](index.md) -- [Examples](http://mathjs.org/examples/index.html) +- [Examples](https://mathjs.org/examples/index.html) diff --git a/docs/index.md b/docs/index.md index 86239a441..f3e77f96e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,13 +1,13 @@ # Documentation -[Math.js](http://mathjs.org) is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices. +[Math.js](https://mathjs.org) is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices. -Math.js can be used in the browser, in node.js and in any JavaScript engine. Installation and download instructions are available on the [Download page](http://mathjs.org/download.html) of the website. +Math.js can be used in the browser, in node.js and in any JavaScript engine. Installation and download instructions are available on the [Download page](https://mathjs.org/download.html) of the website. ## Getting Started - [Getting Started](getting_started.md) -- [Examples](http://mathjs.org/examples/index.html) +- [Examples](//mathjs.org/examples/index.html) ## Documentation diff --git a/docs/reference/classes.md b/docs/reference/classes.md index 68ea34126..36f2851d2 100644 --- a/docs/reference/classes.md +++ b/docs/reference/classes.md @@ -31,7 +31,7 @@ Stores values for a fractional number. Stores values for a arbitrary-precision floating point number. - [Overview](../datatypes/bignumbers.md) -- [Class API](http://mikemcl.github.io/decimal.js/) +- [Class API](https://mikemcl.github.io/decimal.js/) ## Matrix diff --git a/docs/reference/functions/derivative.md b/docs/reference/functions/derivative.md index 3552e1f26..48997c8fe 100644 --- a/docs/reference/functions/derivative.md +++ b/docs/reference/functions/derivative.md @@ -9,7 +9,7 @@ it will return a partial derivative. This uses rules of differentiation which can be found here: -- [Differentiation rules (Wikipedia)](http://en.wikipedia.org/wiki/Differentiation_rules) +- [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules) ## Syntax diff --git a/docs/reference/functions/erf.md b/docs/reference/functions/erf.md index bd001e337..70c1dcc4e 100644 --- a/docs/reference/functions/erf.md +++ b/docs/reference/functions/erf.md @@ -6,7 +6,7 @@ Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x. This is a translation of W. J. Cody's Fortran implementation from 1987 -( http://www.netlib.org/specfun/erf ). See the AMS publication +( https://www.netlib.org/specfun/erf ). See the AMS publication "Rational Chebyshev Approximations for the Error Function" by W. J. Cody for an explanation of this process. diff --git a/docs/reference/functions/eval.md b/docs/reference/functions/eval.md index cbc6ea26d..503d4f8d9 100644 --- a/docs/reference/functions/eval.md +++ b/docs/reference/functions/eval.md @@ -5,7 +5,7 @@ Evaluate an expression. Note the evaluating arbitrary expressions may involve security risks, -see [http://mathjs.org/docs/expressions/security.html](http://mathjs.org/docs/expressions/security.html) for more information. +see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information. ## Syntax diff --git a/docs/reference/functions/mod.md b/docs/reference/functions/mod.md index 33a8bb97f..3b3af3379 100644 --- a/docs/reference/functions/mod.md +++ b/docs/reference/functions/mod.md @@ -10,7 +10,7 @@ The modulus is defined as: x - y * floor(x / y) -See http://en.wikipedia.org/wiki/Modulo_operation. +See https://en.wikipedia.org/wiki/Modulo_operation. ## Syntax diff --git a/docs/reference/functions/parse.md b/docs/reference/functions/parse.md index 48a0d7bfb..4a8366522 100644 --- a/docs/reference/functions/parse.md +++ b/docs/reference/functions/parse.md @@ -6,7 +6,7 @@ Parse an expression. Returns a node tree, which can be evaluated by invoking node.eval(). Note the evaluating arbitrary expressions may involve security risks, -see [http://mathjs.org/docs/expressions/security.html](http://mathjs.org/docs/expressions/security.html) for more information. +see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information. ## Syntax diff --git a/docs/reference/functions/simplify.md b/docs/reference/functions/simplify.md index 3920854dc..b642af6b6 100644 --- a/docs/reference/functions/simplify.md +++ b/docs/reference/functions/simplify.md @@ -33,7 +33,7 @@ and can be used as a basis to built a set of custom rules. For more details on the theory, see: -- [Strategies for simplifying math expressions (Stackoverflow)](http://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions) +- [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions) - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification) An optional `options` argument can be passed as last argument of `simplify`. diff --git a/docs/reference/functions/xgcd.md b/docs/reference/functions/xgcd.md index 8c858cf88..04021b6bb 100644 --- a/docs/reference/functions/xgcd.md +++ b/docs/reference/functions/xgcd.md @@ -3,7 +3,7 @@ # Function xgcd Calculate the extended greatest common divisor for two values. -See http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. +See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. ## Syntax diff --git a/examples/browser/currency_conversion.html b/examples/browser/currency_conversion.html index 835ae53e7..4346b6298 100644 --- a/examples/browser/currency_conversion.html +++ b/examples/browser/currency_conversion.html @@ -33,11 +33,11 @@
- This example demonstrates how you can fetch actual currencies from fixer.io and use them in math.js. + This example demonstrates how you can fetch actual currencies from fixer.io and use them in math.js.
- Create a (free) account at fixer.io and fill in your API access key below: + Create a (free) account at fixer.io and fill in your API access key below: