Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which data type in java can support 10e+10000 number .?

Tags:

java

types

i want to check for palindrome of square of 10e+100 in java. please mention any solution of it because in java double can carry only upto 4.9e-324 to 1.8e+308 numeric values , so please suggest any possible solution or hint may also be helpful...

thanks for your sincere attention.

like image 789
user2277067 Avatar asked Sep 13 '26 11:09

user2277067


2 Answers

You might want to look into the BigInteger class. Here is the documentation.

BigInteger can support huge.. huge numbers!

like image 62
christopher Avatar answered Sep 15 '26 02:09

christopher


For numbers that large, when you only need the standard number of significant digits, it's conventional to represent the number using its logarithm, i.e. you store 10e+100 as 100*log(10) and work with that.

like image 40
Stochastically Avatar answered Sep 15 '26 01:09

Stochastically



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!