mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
Implemented importing and preprocessing of markdown docs
This commit is contained in:
parent
c12d05ce89
commit
a163331540
@ -1,5 +1,8 @@
|
||||
# exclude: updateversion.js // TODO: for some reason this also excludes the js folder...
|
||||
|
||||
markdown: kramdown
|
||||
markdown: redcarpet
|
||||
|
||||
exclude: [node_modules, coverage]
|
||||
|
||||
redcarpet:
|
||||
extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
|
||||
<link href="/css/style.css" rel="stylesheet" type="text/css">
|
||||
<link href="/css/commandline.css" rel="stylesheet" type="text/css">
|
||||
<link href="/css/solarized-light.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<script src="/js/lib/es5-shim.min.js" type="text/javascript"></script>
|
||||
<script src="/js/lib/es5-sham.min.js" type="text/javascript"></script>
|
||||
@ -30,7 +31,6 @@
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<!--
|
||||
<div id="menu">
|
||||
<a href="/index.html">
|
||||
Home
|
||||
@ -49,7 +49,6 @@
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
-->
|
||||
|
||||
{{content}}
|
||||
|
||||
|
||||
61
css/colorful.css
Normal file
61
css/colorful.css
Normal file
@ -0,0 +1,61 @@
|
||||
.highlight .hll { background-color: #ffffcc }
|
||||
.highlight .c { color: #808080 } /* Comment */
|
||||
.highlight .err { color: #F00000; background-color: #F0A0A0 } /* Error */
|
||||
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
|
||||
.highlight .o { color: #303030 } /* Operator */
|
||||
.highlight .cm { color: #808080 } /* Comment.Multiline */
|
||||
.highlight .cp { color: #507090 } /* Comment.Preproc */
|
||||
.highlight .c1 { color: #808080 } /* Comment.Single */
|
||||
.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
|
||||
.highlight .gd { color: #A00000 } /* Generic.Deleted */
|
||||
.highlight .ge { font-style: italic } /* Generic.Emph */
|
||||
.highlight .gr { color: #FF0000 } /* Generic.Error */
|
||||
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
||||
.highlight .go { color: #808080 } /* Generic.Output */
|
||||
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
|
||||
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
||||
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
||||
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
|
||||
.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
|
||||
.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
|
||||
.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
|
||||
.highlight .kp { color: #003080; font-weight: bold } /* Keyword.Pseudo */
|
||||
.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
|
||||
.highlight .kt { color: #303090; font-weight: bold } /* Keyword.Type */
|
||||
.highlight .m { color: #6000E0; font-weight: bold } /* Literal.Number */
|
||||
.highlight .s { background-color: #fff0f0 } /* Literal.String */
|
||||
.highlight .na { color: #0000C0 } /* Name.Attribute */
|
||||
.highlight .nb { color: #007020 } /* Name.Builtin */
|
||||
.highlight .nc { color: #B00060; font-weight: bold } /* Name.Class */
|
||||
.highlight .no { color: #003060; font-weight: bold } /* Name.Constant */
|
||||
.highlight .nd { color: #505050; font-weight: bold } /* Name.Decorator */
|
||||
.highlight .ni { color: #800000; font-weight: bold } /* Name.Entity */
|
||||
.highlight .ne { color: #F00000; font-weight: bold } /* Name.Exception */
|
||||
.highlight .nf { color: #0060B0; font-weight: bold } /* Name.Function */
|
||||
.highlight .nl { color: #907000; font-weight: bold } /* Name.Label */
|
||||
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
|
||||
.highlight .nt { color: #007000 } /* Name.Tag */
|
||||
.highlight .nv { color: #906030 } /* Name.Variable */
|
||||
.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
|
||||
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
||||
.highlight .mf { color: #6000E0; font-weight: bold } /* Literal.Number.Float */
|
||||
.highlight .mh { color: #005080; font-weight: bold } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #0000D0; font-weight: bold } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #4000E0; font-weight: bold } /* Literal.Number.Oct */
|
||||
.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #0040D0 } /* Literal.String.Char */
|
||||
.highlight .sd { color: #D04020 } /* Literal.String.Doc */
|
||||
.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
|
||||
.highlight .se { color: #606060; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
|
||||
.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
|
||||
.highlight .si { background-color: #e0e0e0 } /* Literal.String.Interpol */
|
||||
.highlight .sx { color: #D02000; background-color: #fff0f0 } /* Literal.String.Other */
|
||||
.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
|
||||
.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
|
||||
.highlight .ss { color: #A06000 } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
|
||||
.highlight .vc { color: #306090 } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #d07000; font-weight: bold } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #3030B0 } /* Name.Variable.Instance */
|
||||
.highlight .il { color: #0000D0; font-weight: bold } /* Literal.Number.Integer.Long */
|
||||
79
css/solarized-dark.css
Normal file
79
css/solarized-dark.css
Normal file
@ -0,0 +1,79 @@
|
||||
.highlight {
|
||||
color: #839496 !important;
|
||||
background-color: #002b36 !important; }
|
||||
.highlight .err {
|
||||
color: #dc322f !important;
|
||||
background-color: #073642 !important; }
|
||||
.highlight .cp {
|
||||
color: #586e75 !important;
|
||||
font-weight: bold !important; }
|
||||
.highlight .cs {
|
||||
color: #586e75 !important;
|
||||
font-weight: bold !important;
|
||||
font-style: italic !important; }
|
||||
.highlight .gd {
|
||||
color: #839496 !important;
|
||||
background-color: #fdd !important; }
|
||||
.highlight .gd .x {
|
||||
background-color: #faa !important; }
|
||||
.highlight .ge {
|
||||
font-style: italic !important; }
|
||||
.highlight .gi {
|
||||
background-color: #dfd !important; }
|
||||
.highlight .gi .x {
|
||||
background-color: #afa !important; }
|
||||
.highlight .go {
|
||||
color: #839496 !important; }
|
||||
.highlight .gu {
|
||||
color: #d33682 !important;
|
||||
font-weight: bold !important; }
|
||||
.highlight .gs {
|
||||
font-weight: bold !important; }
|
||||
.highlight .gr, .highlight .gt {
|
||||
color: #d33682 !important; }
|
||||
.highlight .gh {
|
||||
color: #586e75 !important; }
|
||||
.highlight .gp {
|
||||
color: #586e75 !important; }
|
||||
.highlight .nb {
|
||||
color: #859900 !important; }
|
||||
.highlight .ni {
|
||||
color: #d33682 !important; }
|
||||
.highlight .nt {
|
||||
color: #268bd2 !important; }
|
||||
.highlight .w {
|
||||
color: #586e75 !important; }
|
||||
.highlight .sr {
|
||||
color: #859900 !important; }
|
||||
.highlight .ss {
|
||||
color: #2aa198 !important; }
|
||||
.highlight .c, .highlight .cm, .highlight .c1 {
|
||||
color: #586e75 !important;
|
||||
font-style: italic !important; }
|
||||
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .o, .highlight .ow {
|
||||
font-weight: bold !important; }
|
||||
.highlight .k {
|
||||
color: #859900 !important; }
|
||||
.highlight .kt {
|
||||
color: #b58900 !important; }
|
||||
.highlight .bp {
|
||||
color: #93a1a1 !important; }
|
||||
.highlight .nn {
|
||||
color: #93a1a1 !important; }
|
||||
.highlight .nc {
|
||||
color: #b58900 !important;
|
||||
font-weight: bold !important; }
|
||||
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il {
|
||||
color: #2aa198 !important; }
|
||||
.highlight .s, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .s1 {
|
||||
color: #2aa198 !important; }
|
||||
.highlight .na, .highlight .nv {
|
||||
color: #2aa198 !important; }
|
||||
.highlight .no {
|
||||
color: #b58900 !important; }
|
||||
.highlight .vc, .highlight .vg, .highlight .vi {
|
||||
color: #268bd2 !important; }
|
||||
.highlight .ne,
|
||||
.highlight .nf {
|
||||
color: #dc322f !important;
|
||||
font-weight: bold !important; }
|
||||
78
css/solarized-light.css
Normal file
78
css/solarized-light.css
Normal file
@ -0,0 +1,78 @@
|
||||
.highlight {
|
||||
color: #657b83 !important;
|
||||
background-color: #fdf6e3 !important; }
|
||||
.highlight .err {
|
||||
color: #dc322f !important;
|
||||
background-color: #eee8d5 !important; }
|
||||
.highlight .cp {
|
||||
color: #93a1a1 !important;
|
||||
font-weight: bold !important; }
|
||||
.highlight .cs {
|
||||
color: #93a1a1 !important;
|
||||
font-weight: bold !important;
|
||||
font-style: italic !important; }
|
||||
.highlight .gd {
|
||||
background-color: #fdd !important; }
|
||||
.highlight .gd .x {
|
||||
background-color: #faa !important; }
|
||||
.highlight .ge {
|
||||
font-style: italic !important; }
|
||||
.highlight .gi {
|
||||
background-color: #dfd !important; }
|
||||
.highlight .gi .x {
|
||||
background-color: #afa !important; }
|
||||
.highlight .go {
|
||||
color: #657b83 !important; }
|
||||
.highlight .gu {
|
||||
color: #d33682 !important;
|
||||
font-weight: bold !important; }
|
||||
.highlight .gs {
|
||||
font-weight: bold !important; }
|
||||
.highlight .gr, .highlight .gt {
|
||||
color: #d33682 !important; }
|
||||
.highlight .gh {
|
||||
color: #93a1a1 !important; }
|
||||
.highlight .gp {
|
||||
color: #93a1a1 !important; }
|
||||
.highlight .nb {
|
||||
color: #859900 !important; }
|
||||
.highlight .ni {
|
||||
color: #d33682 !important; }
|
||||
.highlight .nt {
|
||||
color: #268bd2 !important; }
|
||||
.highlight .w {
|
||||
color: #93a1a1 !important; }
|
||||
.highlight .sr {
|
||||
color: #859900 !important; }
|
||||
.highlight .ss {
|
||||
color: #2aa198 !important; }
|
||||
.highlight .c, .highlight .cm, .highlight .c1 {
|
||||
color: #93a1a1 !important;
|
||||
font-style: italic !important; }
|
||||
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .o, .highlight .ow {
|
||||
font-weight: bold !important; }
|
||||
.highlight .k {
|
||||
color: #859900 !important; }
|
||||
.highlight .kt {
|
||||
color: #b58900 !important; }
|
||||
.highlight .bp {
|
||||
color: #586e75 !important; }
|
||||
.highlight .nn {
|
||||
color: #586e75 !important; }
|
||||
.highlight .nc {
|
||||
color: #b58900 !important;
|
||||
font-weight: bold !important; }
|
||||
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il {
|
||||
color: #2aa198 !important; }
|
||||
.highlight .s, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .s1 {
|
||||
color: #2aa198 !important; }
|
||||
.highlight .na, .highlight .nv {
|
||||
color: #2aa198 !important; }
|
||||
.highlight .no {
|
||||
color: #b58900 !important; }
|
||||
.highlight .vc, .highlight .vg, .highlight .vi {
|
||||
color: #268bd2 !important; }
|
||||
.highlight .ne,
|
||||
.highlight .nf {
|
||||
color: #dc322f !important;
|
||||
font-weight: bold !important; }
|
||||
@ -167,13 +167,51 @@ div.cols .end {
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
table th,
|
||||
table td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
|
||||
table tr:nth-child(2n) {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
table.download tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
table.download td,
|
||||
table.download th {
|
||||
border: none;
|
||||
padding: 5px 20px 5px 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
code {
|
||||
margin: 0;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 3px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
pre code {
|
||||
margin: inherit;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
border-radius: inherit;
|
||||
padding: inherit;
|
||||
}
|
||||
|
||||
|
||||
#example {
|
||||
font-family: monospace;
|
||||
font-size: 12px;
|
||||
color: #363636;
|
||||
@ -185,13 +223,7 @@ pre {
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid #e5e5e5;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.tiny pre {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#example {
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
|
||||
@ -200,6 +232,10 @@ pre {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.tiny #example {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#example .keyword {
|
||||
color: #004ED0;
|
||||
}
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Chained operations
|
||||
|
||||
Math.js supports chaining operations by wrapping a value into a `Selector`.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Command Line Interface (CLI)
|
||||
|
||||
When math.js is installed globally using npm, its expression parser can be used
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Configuration
|
||||
|
||||
Math.js contains a number of configuration options. Configuration can be set
|
||||
@ -26,7 +30,7 @@ Available configuration options are:
|
||||
|
||||
- `precision`. The maximum number of significant digits for bigNumbers.
|
||||
This setting only applies to BigNumbers, not to numbers.
|
||||
Default value is `20`.
|
||||
Default value is `64`.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Constants
|
||||
|
||||
Math.js has the following built-in constants.
|
||||
@ -10,6 +14,7 @@ Math.js has the following built-in constants.
|
||||
- math.LOG2E
|
||||
- math.LOG10E
|
||||
- math.NaN
|
||||
- math.null
|
||||
- math.PI, math.pi
|
||||
- math.SQRT1_2
|
||||
- math.SQRT2
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# BigNumbers
|
||||
|
||||
For calculations with an arbitrary precision, math.js supports a `BigNumber`
|
||||
@ -15,20 +19,20 @@ a number as input will return a number as output, a BigNumber as input returns
|
||||
a BigNumber as output. Functions which cannot determine the type of output
|
||||
from the input (for example `math.eval`) use the default number type `number`,
|
||||
which can be configured when instantiating math.js. To configure the use of
|
||||
BigNumbers instead of [numbers](numbers.md) by default, configure math.js like:
|
||||
BigNumbers instead of [numbers](numbers.html) by default, configure math.js like:
|
||||
|
||||
```js
|
||||
var mathjs = require('mathjs'),
|
||||
math = mathjs({
|
||||
number: 'bignumber', // Default type of number: 'number' (default) or 'bignumber'
|
||||
precision: 20 // Number of significant digits for BigNumbers
|
||||
precision: 64 // Number of significant digits for BigNumbers
|
||||
});
|
||||
|
||||
// use math
|
||||
math.eval('0.1 + 0.2'); // BigNumber, 0.3
|
||||
```
|
||||
|
||||
The default precision for BigNumber is 20 digits, and can be configured with
|
||||
The default precision for BigNumber is 64 digits, and can be configured with
|
||||
the option `precision`.
|
||||
|
||||
*Important:
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Complex Numbers
|
||||
|
||||
Math.js supports creation, manipulation, and calculations with complex numbers.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Data Types
|
||||
|
||||
The functions of math.js support multiple data types, both native JavaScript
|
||||
@ -8,12 +12,12 @@ Complex number or Array.
|
||||
The supported data types are:
|
||||
|
||||
- Boolean
|
||||
- [Number](numbers.md)
|
||||
- [BigNumber](bignumbers.md)
|
||||
- [Complex](complex_numbers.md)
|
||||
- [Array](matrices.md)
|
||||
- [Matrix](matrices.md)
|
||||
- [Unit](units.md)
|
||||
- [Number](numbers.html)
|
||||
- [BigNumber](bignumbers.html)
|
||||
- [Complex](complex_numbers.html)
|
||||
- [Array](matrices.html)
|
||||
- [Matrix](matrices.html)
|
||||
- [Unit](units.html)
|
||||
- String
|
||||
|
||||
Example usage:
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Matrices
|
||||
|
||||
Math.js supports multi dimensional matrices and arrays. Matrices can be
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Numbers
|
||||
|
||||
Math.js supports two types of numbers:
|
||||
|
||||
- Number for fast floating point arithmetic, described on this page.
|
||||
- BigNumber for arbitrary precision arithmetic, describe on the page
|
||||
[BigNumbers](bignumbers.md).
|
||||
[BigNumbers](bignumbers.html).
|
||||
|
||||
## Configuration
|
||||
|
||||
@ -76,7 +80,7 @@ option `epsilon`. In pseudo code (without exceptions for 0, Infinity and NaN):
|
||||
where:
|
||||
|
||||
- `EPSILON` is the relative difference between x and y. Epsilon is configurable
|
||||
and is `1e-14` by default. See [Configuration](../configuration.md).
|
||||
and is `1e-14` by default. See [Configuration](../configuration.html).
|
||||
- `DBL_EPSILON` is the minimum positive floating point number such that
|
||||
`1.0 + DBL_EPSILON != 1.0`. This is a constant with a value of approximately
|
||||
`2.2204460492503130808472633361816e-16`;
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Units
|
||||
|
||||
Math.js supports units. Units can be used to do calculations and to perform
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Expressions
|
||||
|
||||
Math.js contains a flexible and easy to use expression parser.
|
||||
@ -167,7 +171,6 @@ var math = require('mathjs')();
|
||||
// parse an expression
|
||||
var node = math.parse('sqrt(x/x+1)');
|
||||
node.toString(); // returns 'sqrt((x / x) + 1)'
|
||||
node.toTex(); // returns '\sqrt{{\frac{x}{x}}+{1}}'
|
||||
```
|
||||
|
||||
|
||||
@ -334,7 +337,7 @@ Operators | Description
|
||||
|
||||
Functions are called by entering their name, followed by zero or more
|
||||
arguments enclosed by parentheses. All available functions are listed on the
|
||||
page [Functions](functions.md).
|
||||
page [Functions](functions.html).
|
||||
|
||||
```js
|
||||
math.eval('sqrt(25)'); // 5
|
||||
@ -362,7 +365,7 @@ parser.eval('g(2, 3)'); // 8
|
||||
|
||||
Math.js has a number of built in constants such as `pi` and `e`.
|
||||
All available constants are listed on he page
|
||||
[Constants](constants.md).
|
||||
[Constants](constants.html).
|
||||
|
||||
```js
|
||||
// use constants
|
||||
@ -441,7 +444,7 @@ math.eval('string(2.3)'); // "2.3"
|
||||
|
||||
Math.js uses regular JavaScript numbers, which are floating points with a
|
||||
limited precision and limited range. The limitations are described in detail
|
||||
on the page [Numbers](datatypes/numbers.md).
|
||||
on the page [Numbers](datatypes/numbers.html).
|
||||
|
||||
```js
|
||||
math.eval('1e-325'); // 0
|
||||
@ -469,7 +472,7 @@ math.format(ans, {precision: 14}); // "0.3"
|
||||
|
||||
Math.js supports BigNumbers for calculations with an arbitrary precision.
|
||||
The pros and cons of Number and BigNumber are explained in detail on the page
|
||||
[Numbers](datatypes/numbers.md).
|
||||
[Numbers](datatypes/numbers.html).
|
||||
|
||||
BigNumbers are slower, but have a higher precision. Calculations with big
|
||||
numbers are supported only by arithmetic functions.
|
||||
@ -542,7 +545,7 @@ parser.eval('number(a)'); // Error: 2 + i is no valid number
|
||||
math.js supports units. Units can be used in basic arithmetic operations like
|
||||
add and subtract, and units can be converted from one to another.
|
||||
An overview of all available units can be found on the page
|
||||
[Units](datatypes/units.md).
|
||||
[Units](datatypes/units.html).
|
||||
|
||||
Units can be converted using the operator `to` or `in`.
|
||||
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Functions
|
||||
|
||||
Math.js contains the following functions. The functions support all available
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Import
|
||||
|
||||
The library can easily be extended with functions and variables using the
|
||||
|
||||
@ -16,24 +16,24 @@ and a reference describing all available functions in detail.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- [Getting Started](getting_started.md)
|
||||
- [Getting Started](getting_started.html)
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
- [Constants](constants.md)
|
||||
- [Functions](functions.md)
|
||||
- [Expressions](expressions.md)
|
||||
- [Chained Operations](chained_operations.md)
|
||||
- [Data Types](datatypes/index.md)
|
||||
- [Numbers](datatypes/numbers.md)
|
||||
- [BigNumbers](datatypes/bignumbers.md)
|
||||
- [Complex Numbers](datatypes/complex_numbers.md)
|
||||
- [Matrices](datatypes/matrices.md)
|
||||
- [Units](datatypes/units.md)
|
||||
- [Import](import.md)
|
||||
- [Configuration](configuration.md)
|
||||
- [Command Line Interface](command_line_interface.md)
|
||||
- [Constants](constants.html)
|
||||
- [Functions](functions.html)
|
||||
- [Expressions](expressions.html)
|
||||
- [Chained Operations](chained_operations.html)
|
||||
- [Data Types](datatypes/index.html)
|
||||
- [Numbers](datatypes/numbers.html)
|
||||
- [BigNumbers](datatypes/bignumbers.html)
|
||||
- [Complex Numbers](datatypes/complex_numbers.html)
|
||||
- [Matrices](datatypes/matrices.html)
|
||||
- [Units](datatypes/units.html)
|
||||
- [Import](import.html)
|
||||
- [Configuration](configuration.html)
|
||||
- [Command Line Interface](command_line_interface.html)
|
||||
|
||||
|
||||
## Reference
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function abs
|
||||
|
||||
Calculate the absolute value of a number. For matrices, the function is
|
||||
@ -37,7 +41,7 @@ math.abs([3, -5, -1, 0, 2]); // returns Array [3, 5, 1, 0, 2]
|
||||
|
||||
## See also
|
||||
|
||||
[sign](sign.md)
|
||||
[sign](sign.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function acos
|
||||
|
||||
Calculate the inverse cosine of a value.
|
||||
@ -38,9 +42,9 @@ math.acos(2); // returns Complex 0 + 1.3169578969248166 i
|
||||
|
||||
## See also
|
||||
|
||||
[cos](cos.md),
|
||||
[atan](atan.md),
|
||||
[asin](asin.md)
|
||||
[cos](cos.html),
|
||||
[atan](atan.html),
|
||||
[asin](asin.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function add
|
||||
|
||||
Add two values, `x + y`.
|
||||
@ -45,7 +49,7 @@ math.add(c, d); // returns Unit 52.1 mm
|
||||
|
||||
## See also
|
||||
|
||||
[subtract](subtract.md)
|
||||
[subtract](subtract.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function arg
|
||||
|
||||
Compute the argument of a complex value.
|
||||
@ -41,10 +45,10 @@ math.atan2(3, 2); // returns Number 0.982793723247329
|
||||
|
||||
## See also
|
||||
|
||||
[re](re.md),
|
||||
[im](im.md),
|
||||
[conj](conj.md),
|
||||
[abs](abs.md)
|
||||
[re](re.html),
|
||||
[im](im.html),
|
||||
[conj](conj.html),
|
||||
[abs](abs.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function asin
|
||||
|
||||
Calculate the inverse sine of a value.
|
||||
@ -38,9 +42,9 @@ math.asin(2); // returns Complex 1.5707963267948966 -1.3169578969248
|
||||
|
||||
## See also
|
||||
|
||||
[sin](sin.md),
|
||||
[atan](atan.md),
|
||||
[acos](acos.md)
|
||||
[sin](sin.html),
|
||||
[atan](atan.html),
|
||||
[acos](acos.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function atan
|
||||
|
||||
Calculate the inverse tangent of a value.
|
||||
@ -38,9 +42,9 @@ math.atan(2); // returns Complex 1.5707963267948966 -1.3169578969248
|
||||
|
||||
## See also
|
||||
|
||||
[tan](tan.md),
|
||||
[asin](asin.md),
|
||||
[acos](acos.md)
|
||||
[tan](tan.html),
|
||||
[asin](asin.html),
|
||||
[acos](acos.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function atan2
|
||||
|
||||
Calculate the inverse tangent function with two arguments, y/x.
|
||||
@ -44,10 +48,10 @@ math.atan(2); // returns Complex 1.5707963267948966 -1.3169578969248
|
||||
|
||||
## See also
|
||||
|
||||
[tan](tan.md),
|
||||
[atan](atan.md),
|
||||
[sin](sin.md),
|
||||
[cos](cos.md)
|
||||
[tan](tan.html),
|
||||
[atan](atan.html),
|
||||
[sin](sin.html),
|
||||
[cos](cos.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function bignumber
|
||||
|
||||
Create a BigNumber, which can store numbers with arbitrary precision.
|
||||
@ -39,12 +43,12 @@ math.bignumber('7.2e500'); // returns BigNumber 7.2e500
|
||||
|
||||
## See also
|
||||
|
||||
[boolean](boolean.md),
|
||||
[complex](complex.md),
|
||||
[index](index.md),
|
||||
[matrix](matrix.md),
|
||||
[string](string.md),
|
||||
[unit](unit.md)
|
||||
[boolean](boolean.html),
|
||||
[complex](complex.html),
|
||||
[index](index.html),
|
||||
[matrix](matrix.html),
|
||||
[string](string.html),
|
||||
[unit](unit.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function boolean
|
||||
|
||||
Create a boolean or convert a string or number to a boolean.
|
||||
@ -42,12 +46,12 @@ math.boolean([1, 0, 1, 1]); // returns [true, false, true, true]
|
||||
|
||||
## See also
|
||||
|
||||
[bignumber](bignumber.md),
|
||||
[complex](complex.md),
|
||||
[index](index.md),
|
||||
[matrix](matrix.md),
|
||||
[string](string.md),
|
||||
[unit](unit.md)
|
||||
[bignumber](bignumber.html),
|
||||
[complex](complex.html),
|
||||
[index](index.html),
|
||||
[matrix](matrix.html),
|
||||
[string](string.html),
|
||||
[unit](unit.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function ceil
|
||||
|
||||
Round a value towards plus infinity
|
||||
@ -43,9 +47,9 @@ math.ceil([3.2, 3.8, -4.7]); // returns Array [4, 4, -4]
|
||||
|
||||
## See also
|
||||
|
||||
[floor](floor.md),
|
||||
[fix](fix.md),
|
||||
[round](round.md)
|
||||
[floor](floor.html),
|
||||
[fix](fix.html),
|
||||
[round](round.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function clone
|
||||
|
||||
Clone an object.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function combinations
|
||||
|
||||
Compute the number of ways of picking `k` unordered outcomes from `n`
|
||||
@ -38,8 +42,8 @@ math.combinations(7, 5); // returns 21
|
||||
|
||||
## See also
|
||||
|
||||
[permutations](permutations.md),
|
||||
[factorial](factorial.md)
|
||||
[permutations](permutations.html),
|
||||
[factorial](factorial.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function compare
|
||||
|
||||
Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.
|
||||
@ -48,12 +52,12 @@ math.compare(2, [1, 2, 3]); // returns [1, 0, -1]
|
||||
|
||||
## See also
|
||||
|
||||
[equal](equal.md),
|
||||
[unequal](unequal.md),
|
||||
[smaller](smaller.md),
|
||||
[smallerEq](smallerEq.md),
|
||||
[larger](larger.md),
|
||||
[largerEq](largerEq.md)
|
||||
[equal](equal.html),
|
||||
[unequal](unequal.html),
|
||||
[smaller](smaller.html),
|
||||
[smallerEq](smallerEq.html),
|
||||
[larger](larger.html),
|
||||
[largerEq](largerEq.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function compile
|
||||
|
||||
Parse and compile an expression.
|
||||
@ -44,8 +48,8 @@ nodes[2].eval(); // 12
|
||||
|
||||
## See also
|
||||
|
||||
[parse](parse.md),
|
||||
[eval](eval.md)
|
||||
[parse](parse.html),
|
||||
[eval](eval.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function complex
|
||||
|
||||
Create a complex value or convert a value to a complex value.
|
||||
@ -52,13 +56,13 @@ var d = math.add(a, b); // Complex 5 + 2i
|
||||
|
||||
## See also
|
||||
|
||||
[bignumber](bignumber.md),
|
||||
[boolean](boolean.md),
|
||||
[index](index.md),
|
||||
[matrix](matrix.md),
|
||||
[number](number.md),
|
||||
[string](string.md),
|
||||
[unit](unit.md)
|
||||
[bignumber](bignumber.html),
|
||||
[boolean](boolean.html),
|
||||
[index](index.html),
|
||||
[matrix](matrix.html),
|
||||
[number](number.html),
|
||||
[string](string.html),
|
||||
[unit](unit.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function concat
|
||||
|
||||
Concatenate two or more matrices.
|
||||
@ -43,10 +47,10 @@ math.concat(A, B, 0); // returns [[1, 2], [5, 6], [3, 4], [7, 8]]
|
||||
|
||||
## See also
|
||||
|
||||
[size](size.md),
|
||||
[squeeze](squeeze.md),
|
||||
[subset](subset.md),
|
||||
[transpose](transpose.md)
|
||||
[size](size.html),
|
||||
[squeeze](squeeze.html),
|
||||
[subset](subset.html),
|
||||
[transpose](transpose.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function conj
|
||||
|
||||
Compute the complex conjugate of a complex value.
|
||||
@ -38,10 +42,10 @@ math.conj(math.complex('-5.2i')); // returns Complex 5.2i
|
||||
|
||||
## See also
|
||||
|
||||
[re](re.md),
|
||||
[im](im.md),
|
||||
[arg](arg.md),
|
||||
[abs](abs.md)
|
||||
[re](re.html),
|
||||
[im](im.html),
|
||||
[arg](arg.html),
|
||||
[abs](abs.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function cos
|
||||
|
||||
Calculate the cosine of a value.
|
||||
@ -41,8 +45,8 @@ math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2); // returns Number ~
|
||||
|
||||
## See also
|
||||
|
||||
[cos](cos.md),
|
||||
[tan](tan.md)
|
||||
[cos](cos.html),
|
||||
[tan](tan.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function cosh
|
||||
|
||||
Calculate the hyperbolic cosine of a value,
|
||||
@ -36,8 +40,8 @@ math.cosh(0.5); // returns Number 1.1276259652063807
|
||||
|
||||
## See also
|
||||
|
||||
[sinh](sinh.md),
|
||||
[tanh](tanh.md)
|
||||
[sinh](sinh.html),
|
||||
[tanh](tanh.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function cot
|
||||
|
||||
Calculate the cotangent of a value. `cot(x)` is defined as `1 / tan(x)`.
|
||||
@ -36,9 +40,9 @@ math.cot(2); // returns Number -0.45765755436028577
|
||||
|
||||
## See also
|
||||
|
||||
[tan](tan.md),
|
||||
[sec](sec.md),
|
||||
[csc](csc.md)
|
||||
[tan](tan.html),
|
||||
[sec](sec.html),
|
||||
[csc](csc.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function coth
|
||||
|
||||
Calculate the hyperbolic cotangent of a value,
|
||||
@ -38,9 +42,9 @@ math.coth(2); // returns 1.0373147207275482
|
||||
|
||||
## See also
|
||||
|
||||
[sinh](sinh.md),
|
||||
[tanh](tanh.md),
|
||||
[cosh](cosh.md)
|
||||
[sinh](sinh.html),
|
||||
[tanh](tanh.html),
|
||||
[cosh](cosh.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function csc
|
||||
|
||||
Calculate the cosecant of a value, defined as `csc(x) = 1/sin(x)`.
|
||||
@ -36,9 +40,9 @@ math.csc(2); // returns Number 1.099750170294617
|
||||
|
||||
## See also
|
||||
|
||||
[sin](sin.md),
|
||||
[sec](sec.md),
|
||||
[cot](cot.md)
|
||||
[sin](sin.html),
|
||||
[sec](sec.html),
|
||||
[cot](cot.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function csch
|
||||
|
||||
Calculate the hyperbolic cosecant of a value,
|
||||
@ -38,9 +42,9 @@ math.csch(0.5); // returns 1.9190347513349437
|
||||
|
||||
## See also
|
||||
|
||||
[sinh](sinh.md),
|
||||
[sech](sech.md),
|
||||
[coth](coth.md)
|
||||
[sinh](sinh.html),
|
||||
[sech](sech.html),
|
||||
[coth](coth.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function cube
|
||||
|
||||
Compute the cube of a value, `x * x * x`.
|
||||
@ -39,9 +43,9 @@ math.cube([1, 2, 3, 4]); // returns Array [1, 8, 27, 64]
|
||||
|
||||
## See also
|
||||
|
||||
[multiply](multiply.md),
|
||||
[square](square.md),
|
||||
[pow](pow.md)
|
||||
[multiply](multiply.html),
|
||||
[square](square.html),
|
||||
[pow](pow.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function deepEqual
|
||||
|
||||
Test element wise whether two matrices are equal.
|
||||
@ -41,8 +45,8 @@ math.equal(a, b); // returns [true, false, true]
|
||||
|
||||
## See also
|
||||
|
||||
[equal](equal.md),
|
||||
[unequal](unequal.md)
|
||||
[equal](equal.html),
|
||||
[unequal](unequal.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function det
|
||||
|
||||
Calculate the determinant of a matrix.
|
||||
@ -40,7 +44,7 @@ math.det(A); // returns 6
|
||||
|
||||
## See also
|
||||
|
||||
[inv](inv.md)
|
||||
[inv](inv.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function diag
|
||||
|
||||
Create a diagonal matrix or retrieve the diagonal of a matrix
|
||||
@ -47,9 +51,9 @@ math.diag(a); // returns [1, 5, 9]
|
||||
|
||||
## See also
|
||||
|
||||
[ones](ones.md),
|
||||
[zeros](zeros.md),
|
||||
[eye](eye.md)
|
||||
[ones](ones.html),
|
||||
[zeros](zeros.html),
|
||||
[eye](eye.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function distribution
|
||||
|
||||
Create a distribution object with a set of random functions for given
|
||||
@ -35,9 +39,9 @@ normalDist.random(0, 10); // get a random value between 0 a
|
||||
|
||||
## See also
|
||||
|
||||
[random](random.md),
|
||||
[randomInt](randomInt.md),
|
||||
[pickRandom](pickRandom.md)
|
||||
[random](random.html),
|
||||
[randomInt](randomInt.html),
|
||||
[pickRandom](pickRandom.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function divide
|
||||
|
||||
Divide two values, `x / y`.
|
||||
@ -46,7 +50,7 @@ math.divide(e, 4.5); // returns Unit 4 km
|
||||
|
||||
## See also
|
||||
|
||||
[multiply](multiply.md)
|
||||
[multiply](multiply.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function dotDivide
|
||||
|
||||
Divide two matrices element wise. The function accepts both matrices and
|
||||
@ -41,9 +45,9 @@ math.divide(a, b); // returns [[1.75, 0.75], [-1.75, 2.25]]
|
||||
|
||||
## See also
|
||||
|
||||
[divide](divide.md),
|
||||
[multiply](multiply.md),
|
||||
[dotMultiply](dotMultiply.md)
|
||||
[divide](divide.html),
|
||||
[multiply](multiply.html),
|
||||
[dotMultiply](dotMultiply.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function dotEqual
|
||||
|
||||
Compare two matrices element wise. The function accepts both matrices and
|
||||
@ -41,9 +45,9 @@ math.equal(a, b); // returns false
|
||||
|
||||
## See also
|
||||
|
||||
[equal](equal.md),
|
||||
[unequal](unequal.md),
|
||||
[dotuneuqal](dotuneuqal.md)
|
||||
[equal](equal.html),
|
||||
[unequal](unequal.html),
|
||||
[dotuneuqal](dotuneuqal.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function dotMultiply
|
||||
|
||||
Multiply two matrices element wise. The function accepts both matrices and
|
||||
@ -41,9 +45,9 @@ math.multiply(a, b); // returns [[52, 28], [23, 14]]
|
||||
|
||||
## See also
|
||||
|
||||
[multiply](multiply.md),
|
||||
[divide](divide.md),
|
||||
[dotDivide](dotDivide.md)
|
||||
[multiply](multiply.html),
|
||||
[divide](divide.html),
|
||||
[dotDivide](dotDivide.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function dotPow
|
||||
|
||||
Calculates the power of x to y element wise.
|
||||
@ -38,9 +42,9 @@ math.pow(a, 2); // returns Array [[9, 8], [16, 17]]
|
||||
|
||||
## See also
|
||||
|
||||
[pow](pow.md),
|
||||
[sqrt](sqrt.md),
|
||||
[multiply](multiply.md)
|
||||
[pow](pow.html),
|
||||
[sqrt](sqrt.html),
|
||||
[multiply](multiply.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function dotUnequal
|
||||
|
||||
Test element wise whether two matrices are unequal.
|
||||
@ -41,9 +45,9 @@ math.unequal(a, b); // returns true
|
||||
|
||||
## See also
|
||||
|
||||
[equal](equal.md),
|
||||
[unequal](unequal.md),
|
||||
[dotEqual](dotEqual.md)
|
||||
[equal](equal.html),
|
||||
[unequal](unequal.html),
|
||||
[dotEqual](dotEqual.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function equal
|
||||
|
||||
Test whether two values are equal.
|
||||
@ -20,8 +24,8 @@ math.equal(x, y)
|
||||
|
||||
Parameter | Type | Description
|
||||
--------- | ---- | -----------
|
||||
`x` | Number | BigNumber | Boolean | Complex | Unit | String | Array | Matrix | First value to compare
|
||||
`y` | Number | BigNumber | Boolean | Complex | Unit | String | Array | Matrix | Second value to compare
|
||||
`x` | Number | BigNumber | Boolean | Complex | Unit | String | Array | Matrix | null | undefined | First value to compare
|
||||
`y` | Number | BigNumber | Boolean | Complex | Unit | String | Array | Matrix | null | undefined | Second value to compare
|
||||
|
||||
### Returns
|
||||
|
||||
@ -52,13 +56,13 @@ math.deepEqual(c, d); // returns false
|
||||
|
||||
## See also
|
||||
|
||||
[unequal](unequal.md),
|
||||
[smaller](smaller.md),
|
||||
[smallerEq](smallerEq.md),
|
||||
[larger](larger.md),
|
||||
[largerEq](largerEq.md),
|
||||
[compare](compare.md),
|
||||
[deepEqual](deepEqual.md)
|
||||
[unequal](unequal.html),
|
||||
[smaller](smaller.html),
|
||||
[smallerEq](smallerEq.html),
|
||||
[larger](larger.html),
|
||||
[largerEq](largerEq.html),
|
||||
[compare](compare.html),
|
||||
[deepEqual](deepEqual.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function eval
|
||||
|
||||
Evaluate an expression.
|
||||
@ -41,8 +45,8 @@ math.eval('a * b', scope); // 12
|
||||
|
||||
## See also
|
||||
|
||||
[parse](parse.md),
|
||||
[compile](compile.md)
|
||||
[parse](parse.html),
|
||||
[compile](compile.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function exp
|
||||
|
||||
Calculate the exponent of a value.
|
||||
@ -43,8 +47,8 @@ math.exp([1, 2, 3]);
|
||||
|
||||
## See also
|
||||
|
||||
[log](log.md),
|
||||
[pow](pow.md)
|
||||
[log](log.html),
|
||||
[pow](pow.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function eye
|
||||
|
||||
Create a 2-dimensional identity matrix with size m x n or n x n.
|
||||
@ -38,11 +42,11 @@ math.eye(math.size(b)); // returns [[1, 0, 0], [0, 1, 0]]
|
||||
|
||||
## See also
|
||||
|
||||
[diag](diag.md),
|
||||
[ones](ones.md),
|
||||
[zeros](zeros.md),
|
||||
[size](size.md),
|
||||
[range](range.md)
|
||||
[diag](diag.html),
|
||||
[ones](ones.html),
|
||||
[zeros](zeros.html),
|
||||
[size](size.html),
|
||||
[range](range.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function factorial
|
||||
|
||||
Compute the factorial of a value
|
||||
@ -37,8 +41,8 @@ math.factorial(3); // returns 6
|
||||
|
||||
## See also
|
||||
|
||||
[combinations](combinations.md),
|
||||
[permutations](permutations.md)
|
||||
[combinations](combinations.html),
|
||||
[permutations](permutations.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function fix
|
||||
|
||||
Round a value towards zero.
|
||||
@ -42,9 +46,9 @@ math.fix([3.2, 3.8, -4.7]); // returns Array [3, 3, -4]
|
||||
|
||||
## See also
|
||||
|
||||
[ceil](ceil.md),
|
||||
[floor](floor.md),
|
||||
[round](round.md)
|
||||
[ceil](ceil.html),
|
||||
[floor](floor.html),
|
||||
[round](round.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function floor
|
||||
|
||||
Round a value towards minus infinity.
|
||||
@ -42,9 +46,9 @@ math.floor([3.2, 3.8, -4.7]); // returns Array [3, 3, -5]
|
||||
|
||||
## See also
|
||||
|
||||
[ceil](ceil.md),
|
||||
[fix](fix.md),
|
||||
[round](round.md)
|
||||
[ceil](ceil.html),
|
||||
[fix](fix.html),
|
||||
[round](round.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function forEach
|
||||
|
||||
Iterate over all elements of a matrix/array, and executes the given callback function.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function format
|
||||
|
||||
Format a value of any type into a string.
|
||||
@ -77,7 +81,7 @@ math.format(52.8, {notation: 'exponential'}); // returns '5.28e+1'
|
||||
|
||||
## See also
|
||||
|
||||
[print](print.md)
|
||||
[print](print.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function gcd
|
||||
|
||||
Calculate the greatest common divisor for two or more values or arrays.
|
||||
@ -40,8 +44,8 @@ math.gcd([8, -4], [12, 6]); // returns [4, 2]
|
||||
|
||||
## See also
|
||||
|
||||
[lcm](lcm.md),
|
||||
[xgcd](xgcd.md)
|
||||
[lcm](lcm.html),
|
||||
[xgcd](xgcd.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function help
|
||||
|
||||
Retrieve help on a function or data type.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function ifElse
|
||||
|
||||
Execute a conditional expression.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function im
|
||||
|
||||
Get the imaginary part of a complex number.
|
||||
@ -41,10 +45,10 @@ math.re(math.complex(2.4)); // returns Number 0
|
||||
|
||||
## See also
|
||||
|
||||
[re](re.md),
|
||||
[conj](conj.md),
|
||||
[abs](abs.md),
|
||||
[arg](arg.md)
|
||||
[re](re.html),
|
||||
[conj](conj.html),
|
||||
[abs](abs.html),
|
||||
[arg](arg.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function import
|
||||
|
||||
Import functions from an object or a module
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function index
|
||||
|
||||
Create an index. An Index can store ranges having start, step, and end
|
||||
@ -44,13 +48,13 @@ a.subset(math.index(1, null)); // returns [3, 4]
|
||||
|
||||
## See also
|
||||
|
||||
[bignumber](bignumber.md),
|
||||
[boolean](boolean.md),
|
||||
[complex](complex.md),
|
||||
[matrix](matrix.md),
|
||||
[number](number.md),
|
||||
[string](string.md),
|
||||
[unit](unit.md)
|
||||
[bignumber](bignumber.html),
|
||||
[boolean](boolean.html),
|
||||
[complex](complex.html),
|
||||
[matrix](matrix.html),
|
||||
[number](number.html),
|
||||
[string](string.html),
|
||||
[unit](unit.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function inv
|
||||
|
||||
Calculate the inverse of a square matrix.
|
||||
@ -33,8 +37,8 @@ math.inv(4); // returns 0.25
|
||||
|
||||
## See also
|
||||
|
||||
[det](det.md),
|
||||
[transpose](transpose.md)
|
||||
[det](det.html),
|
||||
[transpose](transpose.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function larger
|
||||
|
||||
Test whether value x is larger than y.
|
||||
@ -45,12 +49,12 @@ math.larger(a, b); // returns false
|
||||
|
||||
## See also
|
||||
|
||||
[equal](equal.md),
|
||||
[unequal](unequal.md),
|
||||
[smaller](smaller.md),
|
||||
[smallerEq](smallerEq.md),
|
||||
[largerEq](largerEq.md),
|
||||
[compare](compare.md)
|
||||
[equal](equal.html),
|
||||
[unequal](unequal.html),
|
||||
[smaller](smaller.html),
|
||||
[smallerEq](smallerEq.html),
|
||||
[largerEq](largerEq.html),
|
||||
[compare](compare.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function largerEq
|
||||
|
||||
Test whether value x is larger or equal to y.
|
||||
@ -41,12 +45,12 @@ math.largerEq(2, 1 + 1); // returns true
|
||||
|
||||
## See also
|
||||
|
||||
[equal](equal.md),
|
||||
[unequal](unequal.md),
|
||||
[smaller](smaller.md),
|
||||
[smallerEq](smallerEq.md),
|
||||
[larger](larger.md),
|
||||
[compare](compare.md)
|
||||
[equal](equal.html),
|
||||
[unequal](unequal.html),
|
||||
[smaller](smaller.html),
|
||||
[smallerEq](smallerEq.html),
|
||||
[larger](larger.html),
|
||||
[compare](compare.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function lcm
|
||||
|
||||
Calculate the least common multiple for two or more values or arrays.
|
||||
@ -44,8 +48,8 @@ math.lcm([4, 6], [6, 21]); // returns [12, 42]
|
||||
|
||||
## See also
|
||||
|
||||
[gcd](gcd.md),
|
||||
[xgcd](xgcd.md)
|
||||
[gcd](gcd.html),
|
||||
[xgcd](xgcd.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function log
|
||||
|
||||
Calculate the logarithm of a value.
|
||||
@ -45,8 +49,8 @@ math.pow(2, 10); // returns 1024
|
||||
|
||||
## See also
|
||||
|
||||
[exp](exp.md),
|
||||
[log10](log10.md)
|
||||
[exp](exp.html),
|
||||
[log10](log10.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function log10
|
||||
|
||||
Calculate the 10-base of a value. This is the same as calculating `log(x, 10)`.
|
||||
@ -38,8 +42,8 @@ math.pow(10, 4); // returns 10000
|
||||
|
||||
## See also
|
||||
|
||||
[exp](exp.md),
|
||||
[log](log.md)
|
||||
[exp](exp.html),
|
||||
[log](log.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function map
|
||||
|
||||
Create a new matrix or array with the results of the callback function executed on
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function matrix
|
||||
|
||||
Create a Matrix. The function creates a new `math.type.Matrix` object from
|
||||
@ -40,13 +44,13 @@ m.get([1, 0]) // number 3
|
||||
|
||||
## See also
|
||||
|
||||
[bignumber](bignumber.md),
|
||||
[boolean](boolean.md),
|
||||
[complex](complex.md),
|
||||
[index](index.md),
|
||||
[number](number.md),
|
||||
[string](string.md),
|
||||
[unit](unit.md)
|
||||
[bignumber](bignumber.html),
|
||||
[boolean](boolean.html),
|
||||
[complex](complex.html),
|
||||
[index](index.html),
|
||||
[number](number.html),
|
||||
[string](string.html),
|
||||
[unit](unit.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function max
|
||||
|
||||
Compute the maximum value of a matrix or a list with values.
|
||||
@ -46,13 +50,13 @@ math.min(2.7, 7.1, -4.5, 2.0, 4.1); // returns -4.5
|
||||
|
||||
## See also
|
||||
|
||||
[mean](mean.md),
|
||||
[median](median.md),
|
||||
[min](min.md),
|
||||
[prod](prod.md),
|
||||
[std](std.md),
|
||||
[sum](sum.md),
|
||||
[var](var.md)
|
||||
[mean](mean.html),
|
||||
[median](median.html),
|
||||
[min](min.html),
|
||||
[prod](prod.html),
|
||||
[std](std.html),
|
||||
[sum](sum.html),
|
||||
[var](var.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function mean
|
||||
|
||||
Compute the mean value of matrix or a list with values.
|
||||
@ -42,13 +46,13 @@ math.mean([[2, 5], [6, 3], [1, 7]], 1); // returns [3.5, 4.5, 4]
|
||||
|
||||
## See also
|
||||
|
||||
[median](median.md),
|
||||
[min](min.md),
|
||||
[max](max.md),
|
||||
[sum](sum.md),
|
||||
[prod](prod.md),
|
||||
[std](std.md),
|
||||
[var](var.md)
|
||||
[median](median.html),
|
||||
[min](min.html),
|
||||
[max](max.html),
|
||||
[sum](sum.html),
|
||||
[prod](prod.html),
|
||||
[std](std.html),
|
||||
[var](var.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function median
|
||||
|
||||
Compute the median of a matrix or a list with values. The values are
|
||||
@ -41,13 +45,13 @@ math.median([3, -1, 5, 7]); // returns 4
|
||||
|
||||
## See also
|
||||
|
||||
[mean](mean.md),
|
||||
[min](min.md),
|
||||
[max](max.md),
|
||||
[sum](sum.md),
|
||||
[prod](prod.md),
|
||||
[std](std.md),
|
||||
[var](var.md)
|
||||
[mean](mean.html),
|
||||
[min](min.html),
|
||||
[max](max.html),
|
||||
[sum](sum.html),
|
||||
[prod](prod.html),
|
||||
[std](std.html),
|
||||
[var](var.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function min
|
||||
|
||||
Compute the maximum value of a matrix or a list of values.
|
||||
@ -46,13 +50,13 @@ math.min(2.7, 7.1, -4.5, 2.0, 4.1); // returns -4.5
|
||||
|
||||
## See also
|
||||
|
||||
[mean](mean.md),
|
||||
[median](median.md),
|
||||
[max](max.md),
|
||||
[prod](prod.md),
|
||||
[std](std.md),
|
||||
[sum](sum.md),
|
||||
[var](var.md)
|
||||
[mean](mean.html),
|
||||
[median](median.html),
|
||||
[max](max.html),
|
||||
[prod](prod.html),
|
||||
[std](std.html),
|
||||
[sum](sum.html),
|
||||
[var](var.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function mod
|
||||
|
||||
Calculates the modulus, the remainder of an integer division.
|
||||
@ -50,7 +54,7 @@ isOdd(3); // returns true
|
||||
|
||||
## See also
|
||||
|
||||
[divide](divide.md)
|
||||
[divide](divide.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function multiply
|
||||
|
||||
Multiply two values, `x * y`. The result is squeezed.
|
||||
@ -46,7 +50,7 @@ math.multiply(3, e); // returns Unit 6.3 km
|
||||
|
||||
## See also
|
||||
|
||||
[divide](divide.md)
|
||||
[divide](divide.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function norm
|
||||
|
||||
Calculate the norm of a number, vector or matrix.
|
||||
@ -49,7 +53,7 @@ math.norm([[1, 2], [3, 4]], 'fro'); // returns 5.477225575051661
|
||||
|
||||
## See also
|
||||
|
||||
[abs](abs.md)
|
||||
[abs](abs.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function number
|
||||
|
||||
Create a number or convert a string to a number.
|
||||
@ -37,13 +41,13 @@ math.number([true, false, true, true]); // returns [1, 0, 1, 1]
|
||||
|
||||
## See also
|
||||
|
||||
[bignumber](bignumber.md),
|
||||
[boolean](boolean.md),
|
||||
[complex](complex.md),
|
||||
[index](index.md),
|
||||
[matrix](matrix.md),
|
||||
[string](string.md),
|
||||
[unit](unit.md)
|
||||
[bignumber](bignumber.html),
|
||||
[boolean](boolean.html),
|
||||
[complex](complex.html),
|
||||
[index](index.html),
|
||||
[matrix](matrix.html),
|
||||
[string](string.html),
|
||||
[unit](unit.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function ones
|
||||
|
||||
Create a matrix filled with ones. The created matrix can have one or
|
||||
@ -39,10 +43,10 @@ math.zeros(math.size(A)); // returns [[1, 1, 1], [1, 1, 1]]
|
||||
|
||||
## See also
|
||||
|
||||
[zeros](zeros.md),
|
||||
[eye](eye.md),
|
||||
[size](size.md),
|
||||
[range](range.md)
|
||||
[zeros](zeros.html),
|
||||
[eye](eye.html),
|
||||
[size](size.html),
|
||||
[range](range.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function parse
|
||||
|
||||
Parse an expression.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function parser
|
||||
|
||||
Create a parser. The function creates a new `math.expression.Parser` object.
|
||||
@ -57,9 +61,9 @@ parser.clear();
|
||||
|
||||
## See also
|
||||
|
||||
[eval](eval.md),
|
||||
[compile](compile.md),
|
||||
[parse](parse.md)
|
||||
[eval](eval.html),
|
||||
[compile](compile.html),
|
||||
[parse](parse.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function permutations
|
||||
|
||||
Compute the number of ways of obtaining an ordered subset of `k` elements
|
||||
@ -40,8 +44,8 @@ math.permutations(5, 3); // 60
|
||||
|
||||
## See also
|
||||
|
||||
[combinations](combinations.md),
|
||||
[factorial](factorial.md)
|
||||
[combinations](combinations.html),
|
||||
[factorial](factorial.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function pickRandom
|
||||
|
||||
Random pick a value from a one dimensional array.
|
||||
@ -34,9 +38,9 @@ math.pickRandom([3, 6, 12, 2]); // returns one of the values in the array
|
||||
|
||||
## See also
|
||||
|
||||
[random](random.md),
|
||||
[randomInt](randomInt.md),
|
||||
[distribution](distribution.md)
|
||||
[random](random.html),
|
||||
[randomInt](randomInt.html),
|
||||
[distribution](distribution.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function pow
|
||||
|
||||
Calculates the power of x to y, `x ^ y`.
|
||||
@ -42,8 +46,8 @@ math.pow(b, 2); // returns Array [[9, 8], [16, 17]]
|
||||
|
||||
## See also
|
||||
|
||||
[multiply](multiply.md),
|
||||
[sqrt](sqrt.md)
|
||||
[multiply](multiply.html),
|
||||
[sqrt](sqrt.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function print
|
||||
|
||||
Interpolate values into a string template.
|
||||
@ -48,7 +52,7 @@ math.print('Hello $user.name! The date is $date', {
|
||||
|
||||
## See also
|
||||
|
||||
[format](format.md)
|
||||
[format](format.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function prod
|
||||
|
||||
Compute the product of a matrix or a list with values.
|
||||
@ -40,13 +44,13 @@ math.prod([[2, 5], [4, 3]]); // returns 120
|
||||
|
||||
## See also
|
||||
|
||||
[mean](mean.md),
|
||||
[median](median.md),
|
||||
[min](min.md),
|
||||
[max](max.md),
|
||||
[sum](sum.md),
|
||||
[std](std.md),
|
||||
[var](var.md)
|
||||
[mean](mean.html),
|
||||
[median](median.html),
|
||||
[min](min.html),
|
||||
[max](max.html),
|
||||
[sum](sum.html),
|
||||
[std](std.html),
|
||||
[var](var.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function random
|
||||
|
||||
Return a random number between `min` and `max` using a uniform distribution.
|
||||
@ -43,9 +47,9 @@ math.random([2, 3]); // returns a 2x3 matrix with random numbers between 0 and 1
|
||||
|
||||
## See also
|
||||
|
||||
[randomInt](randomInt.md),
|
||||
[pickRandom](pickRandom.md),
|
||||
[distribution](distribution.md)
|
||||
[randomInt](randomInt.html),
|
||||
[pickRandom](pickRandom.html),
|
||||
[distribution](distribution.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function randomInt
|
||||
|
||||
Return a random integer number between `min` and `max` using a uniform distribution.
|
||||
@ -43,9 +47,9 @@ math.randomInt([2, 3]); // returns a 2x3 matrix with random integers between 0 a
|
||||
|
||||
## See also
|
||||
|
||||
[randomInt](randomInt.md),
|
||||
[pickRandom](pickRandom.md),
|
||||
[distribution](distribution.md)
|
||||
[randomInt](randomInt.html),
|
||||
[pickRandom](pickRandom.html),
|
||||
[distribution](distribution.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function range
|
||||
|
||||
Create an array from a range.
|
||||
@ -58,10 +62,10 @@ math.range(2, 6, true); // [2, 3, 4, 5, 6]
|
||||
|
||||
## See also
|
||||
|
||||
[ones](ones.md),
|
||||
[zeros](zeros.md),
|
||||
[size](size.md),
|
||||
[subset](subset.md)
|
||||
[ones](ones.html),
|
||||
[zeros](zeros.html),
|
||||
[size](size.html),
|
||||
[subset](subset.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function re
|
||||
|
||||
Get the real part of a complex number.
|
||||
@ -41,10 +45,10 @@ math.re(math.complex(2.4)); // returns Number 2.4
|
||||
|
||||
## See also
|
||||
|
||||
[im](im.md),
|
||||
[conj](conj.md),
|
||||
[abs](abs.md),
|
||||
[arg](arg.md)
|
||||
[im](im.html),
|
||||
[conj](conj.html),
|
||||
[abs](abs.html),
|
||||
[arg](arg.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function resize
|
||||
|
||||
Resize a matrix
|
||||
@ -39,9 +43,9 @@ math.resize("hello", [8], "!"); // returns String 'hello!!!'
|
||||
|
||||
## See also
|
||||
|
||||
[size](size.md),
|
||||
[squeeze](squeeze.md),
|
||||
[subset](subset.md)
|
||||
[size](size.html),
|
||||
[squeeze](squeeze.html),
|
||||
[subset](subset.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function round
|
||||
|
||||
Round a value towards the nearest integer.
|
||||
@ -46,9 +50,9 @@ math.round([3.2, 3.8, -4.7]); // returns Array [3, 4, -5]
|
||||
|
||||
## See also
|
||||
|
||||
[ceil](ceil.md),
|
||||
[fix](fix.md),
|
||||
[floor](floor.md)
|
||||
[ceil](ceil.html),
|
||||
[fix](fix.html),
|
||||
[floor](floor.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Function sec
|
||||
|
||||
Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`.
|
||||
@ -36,9 +40,9 @@ math.sec(2); // returns Number -2.4029979617223822
|
||||
|
||||
## See also
|
||||
|
||||
[cos](cos.md),
|
||||
[csc](csc.md),
|
||||
[cot](cot.md)
|
||||
[cos](cos.html),
|
||||
[csc](csc.html),
|
||||
[cot](cot.html)
|
||||
|
||||
|
||||
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user