Changelog
2014-08-21, version 0.27.0
sort(x [, compare])
and flatten(x)
.null
in all functions.wrap
of function math.import
to false.math.uninitialized
as default value.__transform__
to transform
, and documented
the transform feature.math.import
not applying options when passing a module name.index
consists of
scalar values, and no longer for ranges resolving into a single value.Changelog
2014-08-03, version 0.26.0
math([options])
,
to prevent side effects from math being a function instead of an object.
Instead, use the function math.create([options])
to create a new instance.BigNumber
support for all constants: pi
, tau
, e
, phi
,
E
, LN2
, LN10
, LOG2E
, LOG10E
, PI
, SQRT1_2
, and SQRT2
.BigNumber
support for functions gcd
, xgcd
, and lcm
.gxcd
returning an Array when math.js was configured
as {matrix: 'matrix'}
.ResultSet
instead of an Array
.concat
, min
, max
,
and mean
expect an one-based dimension number.map
and forEach
invoke the callback with one-based indices
when used from within the expression parser.concat
not accepting a BigNumber
for parameter dim
.squeeze
now squeezes both inner and outer singleton dimensions.FunctionNode
to FunctionAssignmentNode
, and renamed ParamsNode
to FunctionNode
for more clarity.Changelog
2014-07-01, version 0.25.0
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})
and math.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 operator a ? 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.
Changelog
2014-06-10, version 0.23.0
Renamed some functions (everything now has a logical, camel case name):
edivide
, emultiply
, and epow
to dotDivide
,
dotMultiply
, and dotPow
respectively.smallereq
and largereq
to smallerEq
and largerEq
.unary
to unaryMinus
and added support for strings.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)
to math.parse(expr, options)
where options: {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;
}
Changelog
2014-05-22, version 0.22.0
5 * cm
).Changelog
2014-05-13, version 0.21.1
crypto
library from the bundle.Parser.parse
and Parser.compile
. Use
math.parse
and math.compile
instead.add
not adding strings and matrices element wise.2^-3
, and a transpose followed by an index like [3]'[1]
.Changelog
2014-04-24, version 0.21.0
cosh
, coth
, csch
,
sech
, sinh
, tanh
. Thanks Rogelio J. Baucells (@rjbaucells).type
to all expression nodes in an expression tree.log
, log10
, pow
, and sqrt
not supporting complex
results from BigNumber input (like sqrt(bignumber(-4))
).Changelog
2014-04-16, version 0.20.0
decimal.js
for BigNumber support, instead of
bignumber.js
.Complex
datatype.
Thanks Finn Pauls (@finnp).exp
, log
, and log10
.a ? b : c
in expression parser.epsilon
.
Thanks Rogelio J. Baucells (@rjbaucells).norm
. Thanks Rogelio J. Baucells (@rjbaucells).ifElse
, is now specified for special data types too.det
. Thanks Bryan Cuccioli (@bcuccioli).BigNumber
support for functions det
and diag
.lbs
(pound mass).decimals
to precision
(applies to BigNumbers
only).