Skip to content

Commit 5e13b30

Browse files
authored
Merge branch 'develop' into broadcasting-functions
2 parents 54338f5 + 153fe77 commit 5e13b30

File tree

23 files changed

+191
-63
lines changed

23 files changed

+191
-63
lines changed

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,5 +282,7 @@ Richard Taylor <richard.taylor@claconnect.com>
282282
NilsDietrich <61544566+NilsDietrich@users.noreply.github.com>
283283
anslem chibuike <144047596+AnslemHack@users.noreply.github.com>
284284
Ayomide Bamigbade <iamtryve@gmail.com>
285+
Dheemanth07 <dheemanth1007@gmail.com>
286+
Anadian <willanad@yandex.com>
285287

286288
# Generated by tools/update-authors.js

HISTORY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# unreleased changes since 15.1.0
44

5+
- Fix: #3631 Handle bigints in `compareNatural` (#3632). Thanks @Dheemanth07.
6+
- Docs: Correct several arithmetic and relational documentation examples
7+
and add History (#3630). Thanks @Anadian.
58
- Fix: #3578 interpret empty true-expr of conditional as error (#3581).
69
Thanks @gwhitney.
710
- Fix: #3597 added nullish type definitions (#3601). Thanks @Ayo1984.

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
math.js
22
https://github.com/josdejong/mathjs
33

4-
Copyright (C) 2013-2025 Jos de Jong <wjosdejong@gmail.com>
4+
Copyright (C) 2013-2026 Jos de Jong <wjosdejong@gmail.com>
55

66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Math.js is an extensive math library for JavaScript and Node.js. It features a f
77
[![Version](https://img.shields.io/npm/v/mathjs.svg)](https://www.npmjs.com/package/mathjs)
88
[![Downloads](https://img.shields.io/npm/dm/mathjs.svg)](https://www.npmjs.com/package/mathjs)
99
[![Build Status](https://github.com/josdejong/mathjs/workflows/Node.js%20CI/badge.svg)](https://github.com/josdejong/mathjs/actions)
10-
[![Maintenance](https://img.shields.io/maintenance/yes/2025.svg)](https://github.com/josdejong/mathjs/graphs/commit-activity)
10+
[![Maintenance](https://img.shields.io/maintenance/yes/2026.svg)](https://github.com/josdejong/mathjs/graphs/commit-activity)
1111
[![License](https://img.shields.io/github/license/josdejong/mathjs.svg)](https://github.com/josdejong/mathjs/blob/master/LICENSE)
1212
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs?ref=badge_shield)
1313
[![Codecov](https://codecov.io/gh/josdejong/mathjs/branch/develop/graph/badge.svg)](https://codecov.io/gh/josdejong/mathjs)
@@ -202,7 +202,7 @@ Thanks, GitHub Actions and LambdaTest for the generous free hosting of this open
202202
mathjs is published under the Apache 2.0 license:
203203

204204
```
205-
Copyright (C) 2013-2025 Jos de Jong <wjosdejong@gmail.com>
205+
Copyright (C) 2013-2026 Jos de Jong <wjosdejong@gmail.com>
206206
207207
Licensed under the Apache License, Version 2.0 (the "License");
208208
you may not use this file except in compliance with the License.

bin/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* cat script.txt | mathjs > results.txt Run input stream, output to file
3131
*
3232
* @license
33-
* Copyright (C) 2013-2025 Jos de Jong <wjosdejong@gmail.com>
33+
* Copyright (C) 2013-2026 Jos de Jong <wjosdejong@gmail.com>
3434
*
3535
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
3636
* use this file except in compliance with the License. You may obtain a copy

src/function/arithmetic/add.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,21 @@ export const createAdd = /* #__PURE__ */ factory(
4545
*
4646
* const c = math.unit('5 cm')
4747
* const d = math.unit('2.1 mm')
48-
* math.add(c, d) // returns Unit 52.1 mm
48+
* math.add(c, d) // returns Unit 5.21 cm
4949
*
5050
* math.add("2.3", "4") // returns number 6.3
5151
*
5252
* See also:
5353
*
5454
* subtract, sum
5555
*
56+
* History:
57+
*
58+
* v13 Handle bigint arguments
59+
* v11.6 Support matrix broadcasting
60+
* v3.8 Allow more than two arguments
61+
* v0.0.2 Created
62+
*
5663
* @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add
5764
* @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add
5865
* @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y`

src/function/arithmetic/cbrt.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,18 @@ export const createCbrt = /* #__PURE__ */ factory(name, dependencies, ({ config,
3636
* math.map([27, 64, 125], x => math.cbrt(x)) // returns [3, 4, 5]
3737
*
3838
* const x = math.complex('8i')
39-
* math.cbrt(x) // returns Complex 1.7320508075689 + i
40-
* math.cbrt(x, true) // returns Matrix [
41-
* // 1.7320508075689 + i
42-
* // -1.7320508075689 + i
43-
* // -2i
44-
* // ]
39+
* math.cbrt(x) // returns 1.7320508075689 + i ...
40+
* math.cbrt(x, true)
41+
* // Complex Matrix ["1.7320508075689+i", "-1.7320508075689+i", "-2i"]
4542
*
4643
* See also:
4744
*
4845
* square, sqrt, cube
4946
*
47+
* History:
48+
*
49+
* v2.3 Created
50+
*
5051
* @param {number | BigNumber | Complex | Unit} x
5152
* Value for which to calculate the cubic root.
5253
* @param {boolean} [allRoots] Optional, false by default. Only applicable

src/function/arithmetic/ceil.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ export const createCeil = /* #__PURE__ */ factory(name, dependencies, ({ typed,
8686
* math.ceil(-4.782, 2) // returns number -4.78
8787
*
8888
* const c = math.complex(3.24, -2.71)
89-
* math.ceil(c) // returns Complex 4 - 2i
89+
* math.ceil(c) // returns Complex 4 - 2i ...
9090
* math.ceil(c, 1) // returns Complex 3.3 - 2.7i
9191
*
9292
* const unit = math.unit('3.241 cm')
9393
* const cm = math.unit('cm')
9494
* const mm = math.unit('mm')
95-
* math.ceil(unit, 1, cm) // returns Unit 3.3 cm
95+
* math.ceil(unit, 1, cm) // returns Unit 3.3 cm ...
9696
* math.ceil(unit, 1, mm) // returns Unit 32.5 mm
9797
*
9898
* math.ceil([3.2, 3.8, -4.7]) // returns Array [4, 4, -4]
@@ -102,6 +102,14 @@ export const createCeil = /* #__PURE__ */ factory(name, dependencies, ({ typed,
102102
*
103103
* floor, fix, round
104104
*
105+
* History:
106+
*
107+
* v14 Handle Units
108+
* v7.4 Allow second "precision" argument
109+
* v5.7 Support tolerance for round-off errors
110+
* v2 Handle Fractions
111+
* v0.1 Created
112+
*
105113
* @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Value to be rounded
106114
* @param {number | BigNumber | Array} [n=0] Number of decimals
107115
* @param {Unit} [valuelessUnit] A valueless unit

src/function/arithmetic/exp.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ export const createExp = /* #__PURE__ */ factory(name, dependencies, ({ typed })
2222
* math.log(math.exp(2)) // returns number 2
2323
*
2424
* math.map([1, 2, 3], math.exp)
25-
* // returns Array [
26-
* // 2.718281828459045,
27-
* // 7.3890560989306495,
28-
* // 20.085536923187668
29-
* // ]
25+
* // returns [2.718281828459045, 7.3890560989306495, 20.085536923187668]
3026
*
3127
* See also:
3228
*
3329
* expm1, expm, log, pow
3430
*
31+
* History:
32+
*
33+
* v11 Don't apply elementwise, avoid confusion with matrix exponential
34+
* v0.20 Handle BigNumbers
35+
* v0.0.2 Created
36+
*
3537
* @param {number | BigNumber | Complex} x A number to exponentiate
3638
* @return {number | BigNumber | Complex} Exponential of `x`
3739
*/

src/function/arithmetic/expm1.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ export const createExpm1 = /* #__PURE__ */ factory(name, dependencies, ({ typed,
2525
* math.log(math.expm1(2) + 1) // returns number 2
2626
*
2727
* math.map([1, 2, 3], math.expm1)
28-
* // returns Array [
29-
* // 1.718281828459045,
30-
* // 6.3890560989306495,
31-
* // 19.085536923187668
32-
* // ]
28+
* // returns [1.718281828459045, 6.3890560989306495, 19.085536923187668]
3329
*
3430
* See also:
3531
*
3632
* exp, expm, log, pow
3733
*
34+
* History:
35+
*
36+
* v11 Don't apply elementwise, avoids confusion with matrix exponential
37+
* v4.2 Created
38+
*
3839
* @param {number | BigNumber | Complex} x The number to exponentiate
3940
* @return {number | BigNumber | Complex} Exponential of `x`, minus one
4041
*/

0 commit comments

Comments
 (0)