Publish mathjs@10.4.2

This commit is contained in:
Jos de Jong 2022-03-29 09:17:36 +02:00
parent 9d55a2313f
commit 9a4041e8f6
28 changed files with 68 additions and 48 deletions

View File

@ -93,7 +93,7 @@ const F = math.multiply(q, math.cross(v, B)) // [0 N, 0 N, -1 N]
All arithmetic operators act on the value of the unit as it is represented in SI units.
This may lead to surprising behavior when working with temperature scales like `celsius` (or `degC`) and `fahrenheit` (or `degF`).
In general you should avoid calculations using `celsius` and `fahrenheit`. Rather, use `kelvin` (or `K`) and `rankine` (or `R`) instead.
In general you should avoid calculations using `celsius` and `fahrenheit`. Rather, use `kelvin` (or `K`) and `rankine` (or `degR`) instead.
This example highlights some problems when using `celsius` and `fahrenheit` in calculations:
```js
@ -139,7 +139,7 @@ An optional `options` object can also be supplied as the last argument to `creat
```js
// Redefine the mile (would not be the first time in history)
math.createUnit('mile', '1609.347218694', {override: true}})
math.createUnit('mile', '1609.347218694 m', {override: true})
```
Base units created without specifying a definition cannot be overridden.

View File

@ -71,6 +71,9 @@ math.format(value, callback)
- `fraction: string`. Available values: 'ratio' (default) or 'decimal'.
For example `format(fraction(1, 3))` will output '1/3' when 'ratio' is
configured, and will output `0.(3)` when 'decimal' is configured.
- `truncate: number`. Specifies the maximum allowed length of the
returned string. If it would have been longer, the excess characters
are deleted and replaced with `'...'`.
- `callback: function`
A custom formatting function, invoked for all numeric elements in `value`,
for example all elements of a matrix, or the real and imaginary

View File

@ -27,7 +27,7 @@ Math.js can be downloaded or linked from various content delivery networks:
<tbody>
<tr>
<td>unpkg</td>
<td><a href="https://unpkg.com/mathjs@10.4.1/">https://unpkg.com/mathjs@10.4.1/</a></td>
<td><a href="https://unpkg.com/mathjs@10.4.2/">https://unpkg.com/mathjs@10.4.2/</a></td>
</tr>
<tr>
<td>cdnjs</td>
@ -47,8 +47,8 @@ Math.js can be downloaded or linked from various content delivery networks:
Or download the full bundle directly from [unpkg](https://unpkg.com):
<p>
<a href="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js">
math.js (version 10.4.1, <span id="size">177 kB</span>, minified and gzipped)
<a href="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js">
math.js (version 10.4.2, <span id="size">178 kB</span>, minified and gzipped)
</a>
</p>

View File

@ -15,7 +15,7 @@
}
</style>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
</head>
<body>

View File

@ -24,7 +24,7 @@ File: [angle_configuration.html](angle_configuration.html) (click for a live dem
}
</style>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
</head>
<body>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>math.js | basic usage</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
</head>
<body>

View File

@ -12,7 +12,7 @@ File: [basic_usage.html](basic_usage.html) (click for a live demo)
<head>
<meta charset="utf-8">
<title>math.js | basic usage</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
</head>
<body>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>math.js | currency conversion</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<style>
body,

View File

@ -13,7 +13,7 @@ File: [currency_conversion.html](currency_conversion.html) (click for a live dem
<meta charset="utf-8">
<title>math.js | currency conversion</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<style>
body,

View File

@ -15,7 +15,7 @@
}
</style>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
</head>
<body>

View File

@ -24,7 +24,7 @@ File: [custom_separators.html](custom_separators.html) (click for a live demo)
}
</style>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
</head>
<body>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>math.js | plot</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<script src="https://cdn.plot.ly/plotly-1.35.2.min.js"></script>

View File

@ -12,7 +12,7 @@ File: [plot.html](plot.html) (click for a live demo)
<head>
<meta charset="utf-8">
<title>math.js | plot</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<script src="https://cdn.plot.ly/plotly-1.35.2.min.js"></script>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>math.js | pretty printing with MathJax</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>

View File

@ -13,7 +13,7 @@ File: [pretty_printing_with_mathjax.html](pretty_printing_with_mathjax.html) (cl
<meta charset="utf-8">
<title>math.js | pretty printing with MathJax</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>math.js | printing HTML</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<style>
body {

View File

@ -13,7 +13,7 @@ File: [printing_html.html](printing_html.html) (click for a live demo)
<meta charset="utf-8">
<title>math.js | printing HTML</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<style>
body {

View File

@ -9,7 +9,7 @@
<script>
// load math.js using require.js
require(['https://unpkg.com/mathjs@10.4.1/lib/browser/math.js'], function (math) {
require(['https://unpkg.com/mathjs@10.4.2/lib/browser/math.js'], function (math) {
// evaluate some expression
const result = math.evaluate('1.2 * (2 + 4.5)')
document.write(result)

View File

@ -18,7 +18,7 @@ File: [requirejs_loading.html](requirejs_loading.html) (click for a live demo)
<script>
// load math.js using require.js
require(['https://unpkg.com/mathjs@10.4.1/lib/browser/math.js'], function (math) {
require(['https://unpkg.com/mathjs@10.4.2/lib/browser/math.js'], function (math) {
// evaluate some expression
const result = math.evaluate('1.2 * (2 + 4.5)')
document.write(result)

View File

@ -5,7 +5,7 @@
<meta charset="utf-8">
<title>math.js | rocket trajectory optimization</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
<style>

View File

@ -14,7 +14,7 @@ File: [rocket_trajectory_optimization.html](rocket_trajectory_optimization.html)
<meta charset="utf-8">
<title>math.js | rocket trajectory optimization</title>
<script src="https://unpkg.com/mathjs@10.4.1/lib/browser/math.js"></script>
<script src="https://unpkg.com/mathjs@10.4.2/lib/browser/math.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
<style>

View File

@ -92,7 +92,7 @@ File: [webworkers.html](webworkers.html) (click for a live demo)
File: [worker.js](worker.js)
```js
importScripts('https://unpkg.com/mathjs@10.4.1/lib/browser/math.js')
importScripts('https://unpkg.com/mathjs@10.4.2/lib/browser/math.js')
// create a parser
const parser = self.math.parser()

View File

@ -1,4 +1,4 @@
importScripts('https://unpkg.com/mathjs@10.4.1/lib/browser/math.js')
importScripts('https://unpkg.com/mathjs@10.4.2/lib/browser/math.js')
// create a parser
const parser = self.math.parser()

View File

@ -4,6 +4,23 @@ layout: default
<h1 id="history">History <a href="#history" title="Permalink">#</a></h1>
<h1 id="20220329-version-1042">2022-03-29, version 10.4.2 <a href="#20220329-version-1042" title="Permalink">#</a></h1>
- Fix <a href="https://github.com/josdejong/mathjs/issues/2499">#2499</a>: different behavior for unit conversion "degC" and "K" <a href="https://github.com/josdejong/mathjs/issues/2501">#2501</a>).
Also disables getting the sign for units with an offset, which is ambiguous.
Thanks <a href="https://github.com/gwhitney">@gwhitney</a>.
- Fix <a href="https://github.com/josdejong/mathjs/issues/2503">#2503</a>: fix an issue in `log()` for complex numbers in which the imaginary
part is much larger in absolute value than the real part, fixed in
`complex.js@2.1.0` <a href="https://github.com/josdejong/mathjs/issues/2505">#2505</a>), thanks <a href="https://github.com/gwhitney">@gwhitney</a>, <a href="https://github.com/infusion">@infusion</a>.
- Fix <a href="https://github.com/josdejong/mathjs/issues/2493">#2493</a>: unclear error message when an entity that is not a function
is being called as a function <a href="https://github.com/josdejong/mathjs/issues/2494">#2494</a>). Thanks <a href="https://github.com/gwhitney">@gwhitney</a>.
- Some fixes in the docs on units <a href="https://github.com/josdejong/mathjs/issues/2498">#2498</a>). Thanks <a href="https://github.com/dvd101x">@dvd101x</a>.
- Add `forEach` example in embedded docs <a href="https://github.com/josdejong/mathjs/issues/2507">#2507</a>). Thanks <a href="https://github.com/dvd101x">@dvd101x</a>.
- Correct approx.deepEqual() to accept an epsilon argument giving the
comparison tolerance. It was already being called this way, but was
silently ignoring the tolerance. Thanks <a href="https://github.com/yifanwww">@yifanwww</a>.
<h1 id="20220323-version-1041">2022-03-23, version 10.4.1 <a href="#20220323-version-1041" title="Permalink">#</a></h1>
- Improve TypeScript definitions for function `unit` <a href="https://github.com/josdejong/mathjs/issues/2479">#2479</a>).

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

30
package-lock.json generated
View File

@ -8,7 +8,7 @@
"name": "mathjs-website",
"version": "1.0.0",
"dependencies": {
"mathjs": "10.4.1"
"mathjs": "10.4.2"
},
"devDependencies": {
"fancy-log": "1.3.3",
@ -675,9 +675,9 @@
}
},
"node_modules/complex.js": {
"version": "2.0.15",
"resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.0.15.tgz",
"integrity": "sha512-gDBvQU8IG139ZBQTSo2qvDFP+lANMGluM779csXOr6ny1NUtA3wkUnCFjlDNH/moAVfXtvClYt6G0zarFbtz5w==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.1.0.tgz",
"integrity": "sha512-RdcrDz7YynXp/YXGwXIZ4MtmxXXniT5WmLFRX93cuXUX+0geWAqB8l1BoLXF+3BkzviVzHlpw27P9ow7MvlcmA==",
"engines": {
"node": "*"
},
@ -2936,12 +2936,12 @@
}
},
"node_modules/mathjs": {
"version": "10.4.1",
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-10.4.1.tgz",
"integrity": "sha512-l/ONB3f2N9MMy/Gx3YPdKXjmV0LKN1Ew2fqcz3tzKlAIcPCFuLlup5KHm9cmKTKMHn7MVJZWegqCQhCDEpYyNQ==",
"version": "10.4.2",
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-10.4.2.tgz",
"integrity": "sha512-3yXxFBR0V2Ij+jk7LV5k15lb+yivRxYRzjmuDYB1+yUzM3x7/XXNjIUZlcyp6l96BUMsOWzgZfIeYxg/dzqxKw==",
"dependencies": {
"@babel/runtime": "^7.17.8",
"complex.js": "^2.0.15",
"complex.js": "^2.1.0",
"decimal.js": "^10.3.1",
"escape-latex": "^1.2.0",
"fraction.js": "^4.2.0",
@ -5128,9 +5128,9 @@
"dev": true
},
"complex.js": {
"version": "2.0.15",
"resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.0.15.tgz",
"integrity": "sha512-gDBvQU8IG139ZBQTSo2qvDFP+lANMGluM779csXOr6ny1NUtA3wkUnCFjlDNH/moAVfXtvClYt6G0zarFbtz5w=="
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.1.0.tgz",
"integrity": "sha512-RdcrDz7YynXp/YXGwXIZ4MtmxXXniT5WmLFRX93cuXUX+0geWAqB8l1BoLXF+3BkzviVzHlpw27P9ow7MvlcmA=="
},
"component-emitter": {
"version": "1.3.0",
@ -7008,12 +7008,12 @@
}
},
"mathjs": {
"version": "10.4.1",
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-10.4.1.tgz",
"integrity": "sha512-l/ONB3f2N9MMy/Gx3YPdKXjmV0LKN1Ew2fqcz3tzKlAIcPCFuLlup5KHm9cmKTKMHn7MVJZWegqCQhCDEpYyNQ==",
"version": "10.4.2",
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-10.4.2.tgz",
"integrity": "sha512-3yXxFBR0V2Ij+jk7LV5k15lb+yivRxYRzjmuDYB1+yUzM3x7/XXNjIUZlcyp6l96BUMsOWzgZfIeYxg/dzqxKw==",
"requires": {
"@babel/runtime": "^7.17.8",
"complex.js": "^2.0.15",
"complex.js": "^2.1.0",
"decimal.js": "^10.3.1",
"escape-latex": "^1.2.0",
"fraction.js": "^4.2.0",

View File

@ -6,7 +6,7 @@
"url": "https://github.com/josdejong/mathjs.git"
},
"dependencies": {
"mathjs": "10.4.1"
"mathjs": "10.4.2"
},
"devDependencies": {
"fancy-log": "1.3.3",