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).Changelog
2014-03-30, version 0.19.0
compare
, sum
, prod
, var
, std
, median
.ifElse
Thanks @mtraynham.Changelog
2014-02-15, version 0.18.1
feet
.compile
(shortcut for parsing and then compiling).pow
for matrices. Thanks @hamadu.combinations
for large numbers, and
improved performance of both functions combinations
and permutations
.Changelog
2014-01-18, version 0.18.0
A[1, 1:3]
instead of A(1, 1:3)
.function
keyword for function assignments in the
expression parser, you can define a function now like f(x) = x^2
.in
to to
. Operator in
is
still available in the expression parser as an alias for to
. Added unit
in
, an abbreviation for inch
. Thanks Elijah Insua (@tmpvar).includeEnd
for function range
(false by default).permutations
and combinations
.
Thanks Daniel Levin (@daniel-levin).l
for unit litre.Changelog
2013-12-19, version 0.17.1
m2
and cubic meter m3
.Changelog
2013-12-12, version 0.17.0
number.defaultType
is now number
.number.precision
is now decimals
.matrix.defaultType
is now matrix
.multiply
now consistently outputs a complex number on complex input.mod
and in
not working as function (only as operator).Changelog
2013-11-28, version 0.16.0
number.defaultType
and number.precision
to configure
big numbers.isScalar
, toScalar
, isVector
, toVector
from Matrix
and Range
. Use math.squeeze
and math.size
instead.get
and set
on Matrix
, for easier and faster
retrieval/replacement of elements in a matrix.resize
, handling matrices, scalars, and strings.ones
and zeros
now return an empty matrix instead of a
number 1 or 0 when no arguments are provided.min
and max
for Range
and Index
.resize
now has an extra optional
parameter defaultValue
.:
in expression parser has been given a higher precedence.config(options
. Options are no longer accessible via math.options
.scientific
notation to exponential
in function format
.format
outputs exponential notation with positive exponents now
always with +
sign, so outputs 2.1e+3
instead of 2.1e3
.squeeze
not being able squeeze into a scalar.resize
and subset
functions.size
now adheres to the option matrix.defaultType
for scalar
input.Changelog
2013-10-26, version 0.15.0
var math = require('mathjs')();
var math = mathjs();
format
now support various options: precision, different
notations (fixed
, scientific
, auto
), and more.format
for Matrix
, Complex
, Unit
, Range
,
and Selector
to format using options.format
does only stringify values now, and has a new parameter
precision
to round to a specific number of digits.math.options.precision
,
use math.format(value [, precision])
instead.print
to interpolate values in a template string,
this functionality was moved from the function format
.mean
. Thanks Guillermo Indalecio Fernandez
(@guillermobox).max
and min
for multi dimensional matrices: they now
return the maximum and minimum of the flattened array. An optional second
argument dim
allows to calculate the max
or min
for specified dimension.math.options.matrix.default
to
math.options.matrix.defaultType
.smaller
,
smallereq
, larger
, largereq
. Complex numbers cannot be ordered.Changelog
2013-10-08, version 0.14.0
math.options.matrix.default
which can have values
matrix
(default) or array
. This option is used by the functions eye
,
ones
, range
, and zeros
, to determine the type of matrix output.concat
.[...]
in the expression parser now creates 1 dimensional
matrices by default. math.eval('[1,2,3,4]')
returns a matrix with
size [4]
, math.eval('[1,2;3,4]')
returns a matrix with size [2,2]
.mod
(modulus operator).Changelog
2013-09-03, version 0.13.0
map
and forEach
. Thanks Sebastien Piquemal (@sebpic).subset
, it now only supports
Array, Matrix, and String.get
and set
from a selector, they are a duplicate
of the function subset
.get
and set
of Matrix
with a single function
subset
.math.expr
to math.expression
(contains Scope, Parser,
node objects).math.docs
to math.expression.docs
.math.expr.Selector
to math.chaining.Selector
.lcm
and xgcd
.