Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,184 members, 7,957,429 topics. Date: Tuesday, 24 September 2024 at 12:21 PM |
Nairaland Forum / Science/Technology / Programming / What Does 1 Million Factorial Look Like? (1543 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 due to the size and time it takes to run. 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)
Want To Learn Mysql / Need A Free Integrated C/C++ Compiler / Top Coder Programming Contest For Java Developers
(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 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11 |