Skip to content

Commit 2768bbc

Browse files
committed
raise ValueError when num or den > 300
1 parent de81618 commit 2768bbc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/isotropic/utils/distribution.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,18 @@ def double_factorial_ratio_scipy(num: int, den: int) -> float:
2020
-------
2121
float
2222
The ratio of the double factorials.
23+
24+
Notes
25+
-----
26+
This only works for numbers up to 300.
27+
28+
Raises
29+
------
30+
ValueError
31+
If num or den is greater than 300.
2332
"""
33+
if num > 300 or den > 300:
34+
raise ValueError("This only works for numbers up to 300")
2435
return factorial2(num) / factorial2(den)
2536

2637

0 commit comments

Comments
 (0)