This content has been marked as final. Show 4 replies
user6102378 wrote:It also says: "if this BigInteger is too big to fit in a long, only the low-order 64 bits are returned".
From the doc "Note that this conversion can lose information about the overall magnitude of the BigInteger value as well as return a result with the opposite sign."
Are there any other possibilities than using a BigInteger for this?For what? All you've done is show us an example where the value is too big for a <tt>long</tt>. Why don't you back up and explain what you're trying to do do, rather than your (plainly flawed) solution.
user6102378 wrote:No. The whole point of BigInteger is for integer values that are arbitrarily large--too large to fit into the fixed-width primitive types. There's nothing else in the language or core API. You might be able to find some thirdparty BigInteger-like class, but you've not indicated why BigIntger doesn't meet your needs, so there's no reason to think you'd find such a class any better, even if you do find it.
Are there any other possibilities than using a BigInteger for this?
The value is too big to fit in a parseLongNo, it's to big to fit in a long. parseLong is an action, not a thing.