Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	package-lock.json
  • Loading branch information
josdejong committed Feb 22, 2024
2 parents 33e6d60 + 4c42a14 commit b32fc94
Show file tree
Hide file tree
Showing 43 changed files with 494 additions and 351 deletions.
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,9 @@ Brooks Smith <brooks.smith@clearcalcs.com>
Alex Edgcomb <aedgcomb@gmail.com>
S.Y. Lee <sylee957@gmail.com>
Hudsxn <143907857+Hudsxn@users.noreply.github.com>
Rich Martinez <6185506+rich-martinez@users.noreply.github.com>
Rich Martinez <richmartinez@Edinas-MacBook-Pro.local>
RandomGamingDev <83996185+RandomGamingDev@users.noreply.github.com>
Brian Fugate <fugateb@yahoo.com>

# Generated by tools/update-authors.js
15 changes: 15 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# History


# 2024-02-22, 12.4.0

- Feat: implement support for trailing commas in matrices (#3154, #2968).
Thanks @dvd101x.
- Feat: improve the performance of `multiply` a lot by adding matrix type
inferencing (#3149). Thanks @RandomGamingDev.
- Fix: #3100 function `round` not handling round-off errors (#3136).
Thanks @BrianFugate.
- Fix: `PartitionedMap` and `ObjectWrappingMap` missing a property
`Symbol.iterator`, causing problems when trying `new Map(scope)` (#3156).
- Fix: type definitions of function `mode` (#3153). Thanks @rich-martinez.
- Docs: describe method `getAllAsMap` in the Parser docs (#3158, #3157).
Thanks @dvd101x.


# 2024-02-08, 12.3.2

- Improved the performance of custom defined functions in the expression
Expand Down
4 changes: 2 additions & 2 deletions docs/datatypes/matrices.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const array = [[2, 0], [-1, 3]] // Array
const matrix = math.matrix([[7, 1], [-2, 3]]) // Matrix

// perform a calculation on an array and matrix
math.square(array) // Array, [[4, 0], [1, 9]]
math.square(matrix) // Matrix, [[49, 1], [4, 9]]
math.map(array, math.square) // Array, [[4, 0], [1, 9]]
math.map(matrix, math.square) // Matrix, [[49, 1], [4, 9]]

// perform calculations with mixed array and matrix input
math.add(array, matrix) // Matrix, [[9, 1], [-3, 6]]
Expand Down
4 changes: 3 additions & 1 deletion docs/expressions/parsing.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ The parser contains the following functions:
- `get(name)`
Retrieve a variable or function from the parser's scope.
- `getAll()`
Retrieve a map with all defined a variables from the parser's scope.
Retrieve an object with all defined variables in the parser's scope.
- `getAllAsMap()`
Retrieve a map with all defined variables in the parser's scope.
- `remove(name)`
Remove a variable or function from the parser's scope.
- `set(name, value)`
Expand Down
13 changes: 0 additions & 13 deletions docs/expressions/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,19 +472,6 @@ parser.evaluate('i * i') // Number, -1
parser.evaluate('sqrt(-4)') // Complex, 2i
```

Math.js does not automatically convert complex numbers with an imaginary part
of zero to numbers. They can be converted to a number using the function
`number`.

```js
// convert a complex number to a number
const parser = math.parser()
parser.evaluate('a = 2 + 3i') // Complex, 2 + 3i
parser.evaluate('b = a - 3i') // Complex, 2 + 0i
parser.evaluate('number(b)') // Number, 2
parser.evaluate('number(a)') // Error: unexpected type of argument
```


### Units

Expand Down

0 comments on commit b32fc94

Please sign in to comment.