BigInteger class

I am not able to solve questions using BigIntegr class …please give me an insight into it…like factorial 0f 100 etc

Hi @rahul.parasmani,
See big integer is used for abnormally large integer calculations. For example, factorial of 100 has 158 digits. In Biginteger we have no upper limit on the range because memory is allocated dynamically. In big integer we mainly handle numbers as strings.
This will be the code for 100 factorial:

	BigInteger ans = new BigInteger("1"); //initialize ans to 1 

	for (int i = 2; i <= N; i++) 
		ans = ans.multiply(BigInteger.valueOf(i)); //multiply ans by 2,3,4...N
    System.out.println(ans);

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.