+ 1
[SOLVED] How sololearn is able to output factorial of 1000 in this code?
In this code factorial of 1000 can be printed with precision. How it is possible? which datatype is used? https://code.sololearn.com/c0BkYtMo3khy/?ref=app
11 odpowiedzi
+ 6
Nandan Kumar Check here. If it possible in Java then why not in C++.
One more thing Ruby automatically understand datatype according to value.
https://code.sololearn.com/cm6sjK48lUpo/?ref=app
+ 5
I have once done a factorial function in C++ that can do it.
That's far from a whole Big Integer type obviously.
https://code.sololearn.com/cV3o3NWxVZ11/?ref=app
+ 4
HonFu Ok
+ 3
For output there is no data type. And also not only on Sololearn you can get on any IDE.
BTW we can store big numbers in BigInteger in java.
+ 3
AJ #Level 20 End Game is it possible in c++
+ 3
AJ #Level 20 End Game unsigned long long allow only upto 2^64-1
unsigned long long allow factorial only upto 20
+ 2
Nandan Kumar Try and Check. Tell me also.😁
+ 2
HonFu so there is no in built datatype in C/C++ which is equivalent to Java's biginteger
+ 2
Nandan Kumar unsigned long long allow. It's equivalent to BigInteger
+ 2
Nandan Kumar No. Check HonFu code. It's allow upto 100 also. Even upto 1000.
+ 2
AJ #Level 20 End Game, that only works because I split up the number into an array.
It wouldn't work just with unsigned long long, after 20! it's over.