Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,989 questions

51,934 answers

573 users

How to use gamma(x) function in Python

2 Answers

0 votes
import math

print("Gamma(0.5) = ", math.gamma(0.5))
print("Gamma(10) = ", math.gamma(10))


'''
run:

Gamma(0.5) =  1.7724538509055159
Gamma(10) =  362880.0

'''

 



answered Oct 14, 2017 by avibootz
0 votes
import math

for i in [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7]:
    print('{:2.1f}  {:5.2f}'.format(i, math.gamma(i)))


'''
run:

1.1   0.95
2.2   1.10
3.3   2.68
4.4  10.14
5.5  52.34
6.6  344.70
7.7  2769.83

'''

 



answered Oct 14, 2017 by avibootz
...