-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
323 changed files
with
7,569 additions
and
15,442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Test out at: https://browsersl.ist/ | ||
|
||
fully supports es6 and fully supports bigint | ||
not dead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
# History | ||
|
||
# 2024-05-31, 13.0.0 | ||
|
||
Breaking changes: | ||
|
||
- Change `isZero`, `isPositive`, and `isNegative` to respect `config.epsilon` | ||
(#3139, #2838). | ||
- Change the behavior of the internal `nearlyEqual` to align with Python and | ||
Julia (#3152, #2838) | ||
- Upgrade to `[email protected]`, | ||
see https://github.com/rawify/Fraction.js/issues/68. | ||
|
||
Non-breaking changes: | ||
|
||
- Implemented support for `bigint` (#3207, #3207) | ||
- Implemented a new config option `config.numberFallback` needed for `bigint` | ||
(#3207). | ||
- Internal: refactored tooling to ES modules and upgraded all devDependencies. | ||
|
||
|
||
# 2024-05-31, 12.4.3 | ||
|
||
- Fix: serialization of Units without a value, see #1240. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# BigInts | ||
|
||
For calculations with large integer numbers, math.js supports the built-in `bigint` data type. | ||
|
||
## Usage | ||
|
||
A bigint can be created either by adding the suffix `n` to a `number`, using the `BigInt` constructor function, or using the util function `math.bigint`: | ||
|
||
```js | ||
42n | ||
BigInt('42') | ||
math.bigint('42') | ||
``` | ||
|
||
Most functions can determine the type of output from the type of input: | ||
a `number` as input will return a `number` as output, a `bigint` as input returns | ||
a `bigint` as output. Functions which cannot determine the type of output | ||
from the input (for example `math.evaluate`) use the default number type `number`, | ||
which can be configured when instantiating math.js. To configure the use of | ||
`bigint` instead of [numbers](numbers.md) by default, configure math.js like: | ||
|
||
```js | ||
math.config({ | ||
number: 'bigint' | ||
}) | ||
|
||
// use math | ||
math.evaluate('70000000000000000123') // bigint 70000000000000000123n | ||
``` | ||
|
||
## Support | ||
|
||
All basic arithmetic functions in math.js support `bigint`. Since `bigint` can only hold integer values, it is not applicable to for example trigonometric functions. When using a `bigint` in a function that does not support it, like `sqrt`, it will convert the `bigint` into a regular `number` and then execute the function: | ||
|
||
```js | ||
math.sin(2n) // number 0.9092974268256817 | ||
``` | ||
|
||
## Conversion | ||
|
||
There are utility functions to convert a `bigint` into a `number` or `BigNumber`: | ||
|
||
```js | ||
// convert a number to bigint or BigNumber | ||
math.bigint(42) // bigint, 42n | ||
math.bignumber(42) // BigNumber, 42 | ||
|
||
// convert a bigint to a number or BigNumber | ||
math.number(42n) // number, 42 | ||
math.bignumber(42n) // BigNumber, 42 | ||
|
||
// losing digits when converting to number | ||
math.number(70000000000000000123n) // number, 7000000000000000000 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
examples/advanced/custom_loading.mjs → examples/advanced/custom_loading.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.