Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find factorial without using Recursion or loop in java?

Tags:

java

factorial

I need to find the factorial in java without using loop or recursion ? So if there is any way then please help . Thanks

like image 633
user1829457 Avatar asked Nov 17 '25 14:11

user1829457


1 Answers

Use Stirling approximation for Gamma function http://en.wikipedia.org/wiki/Stirling%27s_approximation

enter image description here

But it will be not precise.

like image 63
Suzan Cioc Avatar answered Nov 19 '25 06:11

Suzan Cioc