+ 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

22nd Mar 2020, 2:02 PM
Nandan
Nandan - avatar
11 Respostas
+ 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
22nd Mar 2020, 3:05 PM
A͢J
A͢J - avatar
+ 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
22nd Mar 2020, 3:24 PM
HonFu
HonFu - avatar
+ 4
22nd Mar 2020, 4:12 PM
A͢J
A͢J - avatar
+ 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.
22nd Mar 2020, 2:27 PM
A͢J
A͢J - avatar
+ 3
AJ #Level 20 End Game is it possible in c++
22nd Mar 2020, 2:40 PM
Nandan
Nandan - avatar
+ 3
AJ #Level 20 End Game unsigned long long allow only upto 2^64-1 unsigned long long allow factorial only upto 20
22nd Mar 2020, 4:01 PM
Nandan
Nandan - avatar
+ 2
Nandan Kumar Try and Check. Tell me also.😁
22nd Mar 2020, 2:57 PM
A͢J
A͢J - avatar
+ 2
HonFu so there is no in built datatype in C/C++ which is equivalent to Java's biginteger
22nd Mar 2020, 3:45 PM
Nandan
Nandan - avatar
+ 2
Nandan Kumar unsigned long long allow. It's equivalent to BigInteger
22nd Mar 2020, 3:47 PM
A͢J
A͢J - avatar
+ 2
Nandan Kumar No. Check HonFu code. It's allow upto 100 also. Even upto 1000.
22nd Mar 2020, 4:05 PM
A͢J
A͢J - avatar
+ 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.
22nd Mar 2020, 4:11 PM
HonFu
HonFu - avatar