The Gleam Int type behaves differently in the Erlang and JavaScript targets. In the Erlang target it maps to Erlang's integer which is a "big integer", meaning it has arbitrary precision and can be as big as you need. In the JS target, Int maps to Number, which is a floating point value and has max/min values after which it is converted into Infinity, and additionally max/min safe values after which precision suffers.
To provide a consistent interface, I made the little Bigi package: https://hex.pm/packages/bigi. It works the same in both targets, using BigInt in the JS side. It has a rudimentary set of math operations implemented.
I mainly see this as a useful base for other packages that want to maintain correctness without imposing limits, and want to support both targets. If you are just targeting Erlang, you mostly don't need this, and if you are just targeting JS, you can also use the BigInt bindings in https://hex.pm/packages/plinth.