Stats: 3,036,143 members, 7,446,088 topics. Date: Wednesday, 31 May 2023 at 04:53 PM |
Nairaland Forum / Science/Technology / Programming / What Does 1 Million Factorial Look Like? (1366 Views)
How My Learning Path Would Look Like When Im Ready To Start Learning To Code / What Does It Entail To Be A Back-end Developer? / What Does 1 Million Factorial Look Like? (2) (3) (4)
What Does 1 Million Factorial Look Like? by abumeinben(m): 7:51am On Apr 14, 2019 |
Hello geeks, I'm learning some Java coding and I decided to hit on factorial of numbers. I'll drop the code and also the factorial for 1000, 2000, ......30000. 1000000! can crash you PC ![]() Let's start with the code: class Factorial { |
Re: What Does 1 Million Factorial Look Like? by abumeinben(m): 7:51am On Apr 14, 2019 |
1000 3000 |
Re: What Does 1 Million Factorial Look Like? by abumeinben(m): 7:52am On Apr 14, 2019 |
9000! Enter value for factorial: 9000 9000! is ..........0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Digit count is 31682 Common 9000 factorial, nairaland complained of post being too long. The zeros are the last digits
|
Re: What Does 1 Million Factorial Look Like? by abumeinben(m): 7:52am On Apr 14, 2019 |
11-20000 |
Re: What Does 1 Million Factorial Look Like? by abumeinben(m): 7:53am On Apr 14, 2019 |
30000 |
Re: What Does 1 Million Factorial Look Like? by abumeinben(m): 7:53am On Apr 14, 2019 |
100000 |
Re: What Does 1 Million Factorial Look Like? by Olalekank(m): 10:50am On Apr 14, 2019 |
Good one Did you use the multiplication method of 1 * 2 * 3... or you used recursion method? If you use recursive method, it would take a shorter time to run compared to multiplying |
Re: What Does 1 Million Factorial Look Like? by abumeinben(m): 4:54pm On Apr 26, 2019 |
Olalekank: A program in Java was used. |
Re: What Does 1 Million Factorial Look Like? by Superstar007(m): 6:38pm On Apr 26, 2019 |
integer overflow. |
Re: What Does 1 Million Factorial Look Like? by Nobody: 8:03am On Apr 28, 2019 |
Do it recursively |
Re: What Does 1 Million Factorial Look Like? by abumeinben(m): 4:07pm On May 02, 2019 |
Superstar007: yes if you used integers. I used BigInetgers, however. Would drop the code as well Edit: Code added to post |
(1) (Reply)
Creating An Android Book Bank / Every Windows Developer Needs Scoop: A Command-line Installer For Windows / Where Are All My Trolls Gone Too?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2023 Oluwaseun Osewa. All rights reserved. See How To Advertise. 109 |