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
.Changelog
2013-08-22, version 0.12.1
Changelog
2013-08-22, version 0.12.0
random([min, max])
, randomInt([min, max])
,
pickRandom(array)
. Thanks Sebastien Piquemal (@sebpic).distribution(name)
, generating a distribution object
with functions random
, randomInt
, pickRandom
for different
distributions. Currently supporting uniform
and normal
.range
to exclude the upper bound, so range(1, 4)
now returns [1, 2, 3]
instead of [1, 2, 3, 4]
.range
, which is now range(start, end [, step])
instead of range(start, [step, ] end)
.ones
and zeros
to geometric dimensions, for
example ones(3)
returns a vector with length 3, filled with ones, and
ones(3,3)
returns a 2D array with size [3, 3].ones
and zeros
: they now return an Array when
arguments are Numbers or an Array, and returns a Matrix when the argument
is a Matrix.A[0, 0:3]
.Changelog
2013-07-23, version 0.11.0
concat
is now zero-based.true
and false
.boolean
.select
not accepting 0
as input.
Thanks Elijah Manor (@elijahmanor).[[], []]
.