Skip to content

Commit 2ee64d0

Browse files
committed
Add docstrings
1 parent 471ee28 commit 2ee64d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/runtime/random.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
from ltypes import i32, f64, ccall
22

33
def random() -> f64:
4+
"""
5+
Returns a random floating point number in the range [0.0, 1.0)
6+
"""
47
return _lfortran_random_float()
58

69
@ccall
710
def _lfortran_random_float() -> f64:
811
pass
912

1013
def randint(lower: i32, upper: i32) -> i32:
14+
"""
15+
Return a random integer N such that `lower <= N <= upper`.
16+
"""
1117
return _lfortran_random_int(lower, upper)
1218

1319
@ccall

0 commit comments

Comments
 (0)