mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
38 lines
1.3 KiB
Markdown
38 lines
1.3 KiB
Markdown
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
|
|
|
# Function config
|
|
|
|
Set configuration options for math.js, and get current options.
|
|
Will emit a 'config' event, with arguments (curr, prev, changes).
|
|
|
|
|
|
## Syntax
|
|
|
|
```js
|
|
math.config(config: Object): Object
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Parameter | Type | Description
|
|
--------- | ---- | -----------
|
|
`options` | Object | Available options: {number} epsilon Minimum relative difference between two compared values, used by all comparison functions. {string} matrix A string 'Matrix' (default) or 'Array'. {string} number A string 'number' (default), 'BigNumber', or 'Fraction' {number} precision The number of significant digits for BigNumbers. Not applicable for Numbers. {string} parenthesis How to display parentheses in LaTeX and string output. {string} randomSeed Random seed for seeded pseudo random number generator. Set to null to randomly seed.
|
|
|
|
### Returns
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
Object | Returns the current configuration
|
|
|
|
|
|
## Examples
|
|
|
|
```js
|
|
math.config().number; // outputs 'number'
|
|
math.eval('0.4'); // outputs number 0.4
|
|
math.config({number: 'Fraction'});
|
|
math.eval('0.4'); // outputs Fraction 2/5
|
|
```
|
|
|
|
|