Open
Description
BigInteger
is a type that is available not only in Java but also (at least) JavaScript. The current polyglot API already allows getting a polyglot numeric type with the Value
class but nothing is available to do so for BigInteger
.
For example I'd like to have a way to safely read this js
variable:
let bigInteger =
// this is the same as Java Long.MAX_VALUE
BigInt(9223372036854775807)
// ensure that we go over the limits of Long
+ 1n;
Then on a polyglot API:
// some argument we get in interop mode that contains
// the variable described above
Value argument ...
// read it:
BigInteger bi = argument.asBigInteger();
I guess that a fitsInBigInteger()
would be useless to have.