mathjs v11.0.0 Release Notes
Release Date: 2022-07-23 // almost 2 years ago-
!!! BE CAREFUL: BREAKING CHANGES !!!
๐ฅ Breaking changes:
- โฌ๏ธ Dropped official support for IE11.
- โฌ๏ธ Upgraded to
typed-function@3
, see josdejong/typed-function/HISTORY.md. Thanks @gwhitney. Most importantly:- Conversions now have preference over
any
. - The
this
variable is no longer bound to the typed function itself. - The properties
typed.types
,typed.conversions
, andtyped.ignore
have been removed. - There are new static functions available like
typed.referTo
,typed.referToSelf
,typed.addTypes
,typed.addConversions
.
- Conversions now have preference over
- Implement amended "Rule 2" for implicit multiplication (#2370, #2460):
when having a division followed by an implicit multiplication, the division
gets higher precedence over the implicit multiplication when (a) the
numerator is a constant with optionally a prefix operator (
-
,+
,~
), and (b) the denominator is a constant. For example: formerly-1 / 2 x
was interpreted as-1 / (2 * x)
and now it is interpreted as(-1 / 2) * x
. Thanks @gwhitney. - โฌ๏ธ Drop elementwise matrix support for trigonometric functions, exp, log, gamma,
square, sqrt, cube, and cbrt to prevent confusion with standard matrix
functions (#2440, #2465). Instead, use
math.map(matrix, fn)
. Thanks @gwhitney. - Simplify: convert equivalent function calls into operators, for example,
add(2, x)
will now be simplified into2 + x
(#2415, #2466). Thanks @gwhitney. - โ Removed the automatic conversion from
number
tostring
(#2482). Thanks @gwhitney. - ๐ Fix #2412: let function
diff
return an empty matrix when the input contains only one element (#2422). - ๐จ Internal refactoring in the
simplifyCore
logic (#2490, #2484, #2459). The functionsimplifyCore
will no longer (partially) merge constants, that behavior has been moved tosimplifyConstant
. The combination ofsimplifyConstant
andsimplifyCore
is still close to the old behavior ofsimplifyCore
, but there are some differences. To reproduce the same behavior as the oldsimplifyCore
, you can usemath.simplify(expr, [math.simplifyCore, math.simplifyConstant])
. Thanks to the refactoring,simplify
is more thorough in reducing constants. Thanks @gwhitney. - ๐ Disable support for splitting rest parameters in chained calculations
(#2485, #2474). For example:
math.chain(3).max(4, 2).done()
will now throw an error rather than return4
, because the rest parameter ofmath.max(...number)
has been split between the contents of the chain and the arguments to the max call. Thanks @gwhitney. - Function
typeOf
now returnsfunction
(lowercase) for a function instead ofFunction
(#2560). Thanks @gwhitney.
Non-breaking changes:
- ๐ Fix #2600: improve the TypeScript definitions of
simplify
. Thanks @laureen-m and @mattvague. - ๐ Fix #2607: improve type definition of
createUnit
. Thanks @egziko. - ๐ Fix #2608: clarify the docs on the need to configure a smaller
epsilon
when using BigNumbers. - ๐ Fix #2613: describe matrix methods
get
andset
in the docs. - ๐ Fix link to
math.rationalize
in the docs (#2616). Thanks @nukisman. - ๐ Fix #2621: add TypeScript definitions for
count
(#2622). Thanks @Hansuku. - ๐ Improved TypeScript definitions of
multiply
(#2623). Thanks @Windrill.