Add info about limits

This commit is contained in:
Mikko Ahlroth 2024-09-13 08:14:40 +03:00
parent cbfb411bb6
commit 149742e7c0

View file

@ -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