mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
Updated gamma
This commit is contained in:
parent
1d4fc814fa
commit
7bd84b4eee
@ -5,12 +5,12 @@ for more info: https://en.wikipedia.org/wiki/Gamma_function
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# Importing packages
|
# Importing packages
|
||||||
from math import sqrt, pi
|
from math import pi, sqrt
|
||||||
from re import match
|
from re import match
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
|
||||||
def gamma(num : Union[int, float]) -> Union[int, float]:
|
def gamma(num: Union[int, float]) -> Union[int, float]:
|
||||||
"""
|
"""
|
||||||
Calculates the value of Gamma function of num
|
Calculates the value of Gamma function of num
|
||||||
where num is either an integer (1,2,3..) or a half-integer (0.5,1.5,2.5...).
|
where num is either an integer (1,2,3..) or a half-integer (0.5,1.5,2.5...).
|
||||||
@ -80,4 +80,4 @@ if __name__ == "__main__":
|
|||||||
results = results.rstrip("0").rstrip(".")
|
results = results.rstrip("0").rstrip(".")
|
||||||
if results == "1":
|
if results == "1":
|
||||||
results = ""
|
results = ""
|
||||||
print(results + "\u221A\u03c0")
|
print(results + "\u221A\u03c0")
|
||||||
|
Loading…
Reference in New Issue
Block a user