Skip to content

Commit a96efba

Browse files
committed
small comments and other slight changes
1 parent 9d6b50e commit a96efba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Linear congruential generator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ def randomInt(): # range [0 to 2^48]
2020
def randomFloat(): # range [0 to 1]
2121
return (randomInt() / modulus)
2222

23-
def randomIntRange(min, max): # custom range
23+
def randomIntRange(min, max): # custom range [minimum, maximum]
2424
return (math.floor(randomFloatRange(min, max)))
2525

26-
def randomFloatRange(min, max): # custom range
26+
def randomFloatRange(min, max): # custom range [minimum, maximum]
2727
return (min + randomFloat() * (max - min))
2828

29-
def randomBool(chance): # chance of getting true
29+
def randomBool(chance): # chance of getting true (example: randomBool(20) has a 20% chance of returning true)
3030
if(chance == 0):
3131
chance = 0.5
3232
return (randomFloat() < chance)
3333

3434

35-
# execute functions
35+
# execute functions and print results
3636
print("Sequence of Random Integers between 0 and the Modulus")
3737
print(randomInt())
3838
print(randomInt())

0 commit comments

Comments
 (0)