From 6565fef586e53d859397ffca94cf8f8eeabb2a9f Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Wed, 21 May 2025 15:32:28 +0200 Subject: [PATCH] chore: publish `v14.5.0` --- docs/core/configuration.md | 1 + docs/expressions/syntax.md | 22 ++++++++++++++- docs/reference/functions.md | 2 +- docs/reference/functions/parser.md | 2 +- download.md | 8 +++--- examples/browser/angle_configuration.html | 2 +- examples/browser/angle_configuration.html.md | 2 +- examples/browser/basic_usage.html | 2 +- examples/browser/basic_usage.html.md | 2 +- examples/browser/currency_conversion.html | 2 +- examples/browser/currency_conversion.html.md | 2 +- examples/browser/custom_separators.html | 2 +- examples/browser/custom_separators.html.md | 2 +- examples/browser/lorenz.html | 2 +- examples/browser/lorenz.html.md | 2 +- examples/browser/lorenz_interactive.html | 2 +- examples/browser/lorenz_interactive.html.md | 2 +- examples/browser/plot.html | 2 +- examples/browser/plot.html.md | 2 +- .../browser/pretty_printing_with_mathjax.html | 2 +- .../pretty_printing_with_mathjax.html.md | 2 +- examples/browser/printing_html.html | 2 +- examples/browser/printing_html.html.md | 2 +- examples/browser/requirejs_loading.html | 2 +- examples/browser/requirejs_loading.html.md | 2 +- .../rocket_trajectory_optimization.html | 2 +- .../rocket_trajectory_optimization.html.md | 2 +- examples/browser/webworkers/index.md | 2 +- examples/browser/webworkers/worker.js | 2 +- history.md | 11 ++++++++ js/lib/math.js | 2 +- js/lib/math.js.LICENSE.txt | 4 +-- js/lib/math.js.map | 2 +- mathjs-src | 2 +- package-lock.json | 28 +++++++++---------- package.json | 4 +-- 36 files changed, 84 insertions(+), 52 deletions(-) diff --git a/docs/core/configuration.md b/docs/core/configuration.md index 5a8e651cb..1eb4b8ded 100644 --- a/docs/core/configuration.md +++ b/docs/core/configuration.md @@ -16,6 +16,7 @@ const config = { absTol: 1e-15, matrix: 'Matrix', number: 'number', + numberFallback: 'number', precision: 64, predictable: false, randomSeed: null diff --git a/docs/expressions/syntax.md b/docs/expressions/syntax.md index 58a06b460..6962d9391 100644 --- a/docs/expressions/syntax.md +++ b/docs/expressions/syntax.md @@ -4,7 +4,7 @@ layout: default

Expression syntax #

-This page describes the syntax of expression parser of math.js. It describes +This page describes the syntax of the expression parser of math.js. It describes how to work with the available data types, functions, operators, variables, and more. @@ -253,6 +253,26 @@ Note that math.js embodies a preference for the operator forms, in that calling `simplify` (see [Algebra](./algebra.html)) converts any instances of the function form into the corresponding operator. +

Methods #

+ +Some data types have methods which can be used in the parser using the dot notation, for example: + +```js +const parser = math.parser() + +parser.evaluate('a = 1 m') // Unit 1 m +parser.evaluate('a.toNumber("mm")') // 1000 +``` + +Or a method on a Matrix or Array: + +```js +const parser = math.parser() + +parser.evaluate('M = [4, 9, 25]') // Matrix [4, 9, 25] +parser.evaluate('M.map(sqrt)') // Matrix [2, 3, 5] +``` +

Map and forEach #

The `map` and `forEach` functions can be used to apply a callback function to each element of an array or matrix. diff --git a/docs/reference/functions.md b/docs/reference/functions.md index fd4d33a70..e8131920c 100644 --- a/docs/reference/functions.md +++ b/docs/reference/functions.md @@ -11,7 +11,7 @@ Function | Description [math.compile(expr)](functions/compile.html) | Parse and compile an expression. [math.evaluate(expr [, scope])](functions/evaluate.html) | Evaluate an expression. [math.help(search)](functions/help.html) | Retrieve help on a function or data type. -[math.parser()](functions/parser.html) | Create a parser. +[math.parser()](functions/parser.html) | Create a `math.

Algebra functions #

diff --git a/docs/reference/functions/parser.md b/docs/reference/functions/parser.md index b7627b252..5ef3f3527 100644 --- a/docs/reference/functions/parser.md +++ b/docs/reference/functions/parser.md @@ -6,7 +6,7 @@ layout: default

Function parser #

-Create a parser. The function creates a new `math.Parser` object. +Create a `math.Parser` object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.

Syntax #

diff --git a/download.md b/download.md index 26e762e7d..d43753965 100644 --- a/download.md +++ b/download.md @@ -27,7 +27,7 @@ Math.js can be downloaded or linked from various content delivery networks: unpkg - https://unpkg.com/mathjs@14.4.0/ + https://unpkg.com/mathjs@14.5.0/ cdnjs @@ -48,9 +48,9 @@ Or download the full bundle directly from [unpkg](https://unpkg.com):

math.js (version 14.4.0, 186 kB, minified and gzipped) - and if needed the source map + href="https://unpkg.com/mathjs@14.5.0/lib/browser/math.js" + >math.js (version 14.5.0, 186 kB, minified and gzipped) + and if needed the source map

Too large for you? Create your own [custom bundle](docs/custom_bundling.html). diff --git a/examples/browser/angle_configuration.html b/examples/browser/angle_configuration.html index 08059d89d..60474b5e1 100644 --- a/examples/browser/angle_configuration.html +++ b/examples/browser/angle_configuration.html @@ -15,7 +15,7 @@ } - + diff --git a/examples/browser/angle_configuration.html.md b/examples/browser/angle_configuration.html.md index eedaa7021..7e2583735 100644 --- a/examples/browser/angle_configuration.html.md +++ b/examples/browser/angle_configuration.html.md @@ -24,7 +24,7 @@ File: [angle_configuration.html](angle_configuration.html) (click for a live dem } - + diff --git a/examples/browser/basic_usage.html b/examples/browser/basic_usage.html index f25ae505a..9246cf536 100644 --- a/examples/browser/basic_usage.html +++ b/examples/browser/basic_usage.html @@ -3,7 +3,7 @@ math.js | basic usage - + diff --git a/examples/browser/basic_usage.html.md b/examples/browser/basic_usage.html.md index 44558631f..7e86f0689 100644 --- a/examples/browser/basic_usage.html.md +++ b/examples/browser/basic_usage.html.md @@ -12,7 +12,7 @@ File: [basic_usage.html](basic_usage.html) (click for a live demo) math.js | basic usage - + diff --git a/examples/browser/currency_conversion.html b/examples/browser/currency_conversion.html index 7148e9dec..f23db5d67 100644 --- a/examples/browser/currency_conversion.html +++ b/examples/browser/currency_conversion.html @@ -4,7 +4,7 @@ math.js | currency conversion - + - + diff --git a/examples/browser/custom_separators.html.md b/examples/browser/custom_separators.html.md index 1e50a2948..eb0784c5d 100644 --- a/examples/browser/custom_separators.html.md +++ b/examples/browser/custom_separators.html.md @@ -24,7 +24,7 @@ File: [custom_separators.html](custom_separators.html) (click for a live demo) } - + diff --git a/examples/browser/lorenz.html b/examples/browser/lorenz.html index c8e50508a..702b9dd42 100644 --- a/examples/browser/lorenz.html +++ b/examples/browser/lorenz.html @@ -4,7 +4,7 @@ math.js | Lorenz Attractor - +