Add info about limits
This commit is contained in:
parent
cbfb411bb6
commit
149742e7c0
1 changed files with 22 additions and 0 deletions
22
README.md
22
README.md
|
@ -46,6 +46,28 @@ pub fn main() {
|
|||
|
||||
Further documentation can be found at <https://hexdocs.pm/bigi>.
|
||||
|
||||
## Limitations
|
||||
|
||||
Erlang does have [a limit for big integers at around 4 megabits](https://elixirforum.com/t/is-there-an-integer-size-limit/65647/8?u=nicd),
|
||||
as demonstrated below:
|
||||
|
||||
```gleam
|
||||
import bigi
|
||||
|
||||
pub fn main() {
|
||||
// Works
|
||||
bigi.power(bigi.from_int(2), bigi.from_int(4_194_239))
|
||||
|
||||
// Blows up
|
||||
bigi.power(bigi.from_int(2), bigi.from_int(4_194_240))
|
||||
}
|
||||
```
|
||||
|
||||
For Node.js, the limit is somewhere higher.
|
||||
|
||||
`bigi` has no facilities to warn about or handle errors due to these system limits. It is up to the developer
|
||||
to be mindful of them.
|
||||
|
||||
## Development
|
||||
|
||||
```sh
|
||||
|
|
Loading…
Reference in a new issue