My question is that, I want to multiply 2 number which has 1 million digit. When I tried to assign 1 million number to BigInteger, Compiler is giving to me error. The error is that:"constant string too long".
相关问题
- how to split a list into a given number of sub-lis
- Generate string from integer with arbitrary base i
- (ASP.NET) Project file must include 'WindowsBa
- Converting a string array to a byte array
- How to convert a string to a byte array which is c
相关文章
- JSP String formatting Truncate
- Selecting only the first few characters in a strin
- Python: print in two columns
- Object property assignment with destructuring?
- extending c++ string member functions
- Google app engine datastore string encoding proble
- How to measure complexity of a string?
- What is the limit in size of a Php variable when s
BigInteger
is indeed the way to store such large integers, although hundreds or a few thousands of digits are more typical use cases. However, Java class files have limitations that won't allow hard coding a literal number that large.Instead, store the number in a file and read it at runtime. If the file contains a textual representation in decimal, hexadecimal, or some other base, you can read it into a
String
and pass it to theBigInteger
constructor. If the file contains the raw bits, load it to abyte[]
and use a different constructor.