Changelog History
Page 21
-
v1.1.0 Changes
November 15, 2014- Implemented functions
dot
(dot product),cross
(cross product), andnthRoot
. - Officially opened up the API of expression trees:
- Documented the API.
- Implemented recursive functions
clone
,map
,forEach
,traverse
,transform
, andfilter
for expression trees. - Parameter
index
in the callbacks ofmap
andforEach
are now cloned for every callback. - Some internal refactoring inside nodes to make the API consistent:
- Renamed
params
toargs
and vice versa to make things consistent. - Renamed
Block.nodes
toBlock.blocks
. FunctionNode
now has aname: string
instead of asymbol: SymbolNode
.- Changed constructor of
RangeNode
tonew RangeNode(start: Node, end: Node [, step: Node])
. - Nodes for a
BlockNode
must now be passed via the constructor instead of via a functionadd
.
- ๐ Fixed
2e
giving a syntax error instead of being parsed as2 * e
.
- Implemented functions
-
v1.0.1 Changes
September 12, 2014- ๐ Disabled array notation for ranges in a matrix index in the expression parser (it is confusing and redundant there).
- ๐ Fixed a regression in the build of function subset not being able to return a scalar.
- ๐ Fixed some missing docs and broken links in the docs.
-
v1.0.0 Changes
September 04, 2014- โ
Implemented a function
filter(x, test)
. - โ Removed
math.distribution
for now, needs some rethinking. math.number
can convert units to numbers (requires a second argument)- ๐ Fixed some precedence issues with the range and conversion operators.
- ๐ Fixed an zero-based issue when getting a matrix subset using an index containing a matrix.
- โ
Implemented a function
-
v0.27.0 Changes
August 21, 2014- Implemented functions
sort(x [, compare])
andflatten(x)
. - ๐ Implemented support for
null
in all functions. - ๐ Implemented support for "rawArgs" functions in the expression parser. Raw functions are invoked with unevaluated parameters (nodes).
- ๐ Expressions in the expression parser can now be spread over multiple lines, like '2 +\n3'.
- ๐ Changed default value of the option
wrap
of functionmath.import
to false. - ๐ Changed the default value for new entries in a resized matrix when to zero.
To leave new entries uninitialized, use the new constant
math.uninitialized
as default value. - Renamed transform property from
__transform__
totransform
, and documented the transform feature. - ๐ Fixed a bug in
math.import
not applying options when passing a module name. - A returned matrix subset is now only squeezed when the
index
consists of scalar values, and no longer for ranges resolving into a single value.
- Implemented functions
-
v0.26.0 Changes
August 03, 2014- A new instance of math.js can no longer be created like
math([options])
, to prevent side effects from math being a function instead of an object. Instead, use the functionmath.create([options])
to create a new instance. - ๐ Implemented
BigNumber
support for all constants:pi
,tau
,e
,phi
,E
,LN2
,LN10
,LOG2E
,LOG10E
,PI
,SQRT1_2
, andSQRT2
. - ๐ Implemented
BigNumber
support for functionsgcd
,xgcd
, andlcm
. - ๐ Fixed function
gxcd
returning an Array when math.js was configured as{matrix: 'matrix'}
. - Multi-line expressions now return a
ResultSet
instead of anArray
. - Implemented transforms (used right now to transform one-based indices to zero-based for expressions).
- ๐ When used inside the expression parser, functions
concat
,min
,max
, andmean
expect an one-based dimension number. - Functions
map
andforEach
invoke the callback with one-based indices when used from within the expression parser. - When adding or removing dimensions when resizing a matrix, the dimensions are added/removed from the inner side (right) instead of outer side (left).
- ๐ Improved index out of range errors.
- ๐ Fixed function
concat
not accepting aBigNumber
for parameterdim
. - Function
squeeze
now squeezes both inner and outer singleton dimensions. - Output of getting a matrix subset is not automatically squeezed anymore except for scalar output.
- ๐ Renamed
FunctionNode
toFunctionAssignmentNode
, and renamedParamsNode
toFunctionNode
for more clarity. - ๐ Fixed broken auto completion in CLI.
- ๐ Some minor fixes.
- A new instance of math.js can no longer be created like
-
v0.25.0 Changes
July 01, 20140๏ธโฃ The library now immediately returns a default instance of mathjs, there is no need to instantiate math.js in a separate step unless one ones to set configuration options:
// instead of: var mathjs = require('mathjs'), // load math.js math = mathjs(); // create an instance // just do: var math = require('mathjs');
๐ Implemented support for implicit multiplication, like
math.eval('2a', {a:3})
andmath.eval('(2+3)(1-3)')
. This changes behavior of matrix indexes as well: an expression like[...][...]
is not evaluated as taking a subset of the first matrix, but as an implicit multiplication of two matrices.โ Removed utility function
ifElse
. This function is redundant now the expression parser has a conditional operatora ? b : c
.๐ Fixed a bug with multiplying a number with a temperature, like
math.eval('10 * celsius')
.๐ Fixed a bug with symbols having value
undefined
not being evaluated.
-
v0.24.1 Changes
June 20, 2014- Something went wrong with publishing on npm.
-
v0.24.0 Changes
June 20, 2014- โ Added constant
null
. - ๐ Functions
equal
andunequal
supportnull
andundefined
now. - Function
typeof
now recognizes regular expressions as well. - Objects
Complex
,Unit
, andHelp
now return their string representation when calling.valueOf()
. - ๐ Changed the default number of significant digits for BigNumbers from 20 to 64.
- ๐ Changed the behavior of the conditional operator (a ? b : c) to lazy evaluating.
- ๐ Fixed imported, wrapped functions not accepting
null
andundefined
as function arguments.
- โ Added constant
-
v0.23.0 Changes
June 10, 2014- ๐ Renamed some functions (everything now has a logical, camel case name):
- Renamed functions
edivide
,emultiply
, andepow
todotDivide
,dotMultiply
, anddotPow
respectively. - Renamed functions
smallereq
andlargereq
tosmallerEq
andlargerEq
. - Renamed function
unary
tounaryMinus
and added support for strings.
- Renamed functions
end
is now a reserved keyword which cannot be used as function or symbol name in the expression parser, and is not allowed in the scope against which an expression is evaluated.- Implemented function
unaryPlus
and unary plus operator. - Implemented function
deepEqual
for matrix comparisons. - โ Added constant
phi
, the golden ratio (phi = 1.618...
). - โ Added constant
version
, returning the version number of math.js as string. - โ Added unit
drop
(gtt
). - ๐ Fixed not being able to load math.js using AMD/require.js.
- ๐ Changed signature of
math.parse(expr, nodes)
tomath.parse(expr, options)
whereoptions: {nodes: Object.<String, Node>}
- โ Removed matrix support from conditional function
ifElse
. โ Removed automatic assignment of expression results to variable
ans
. This functionality can be restored by pre- or postprocessing every evaluation, something like:function evalWithAns (expr, scope) { var ans = math.eval(expr, scope); if (scope) { scope.ans = ans; } return ans; }
- ๐ Renamed some functions (everything now has a logical, camel case name):
-
v0.22.0 Changes
May 22, 2014- ๐ Implemented support to export expressions to LaTeX. Thanks Niels Heisterkamp (@nheisterkamp).
- Output of matrix multiplication is now consistently squeezed.
- โ Added reference documentation in the section /docs/reference.
- ๐ Fixed a bug in multiplying units without value with a number (like
5 * cm
). - ๐ Fixed a bug in multiplying two matrices containing vectors (worked fine for arrays).
- ๐ Fixed random functions not accepting Matrix as input, and always returning a Matrix as output.