aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-08-12 11:56:24 +0000
committerlaforge <laforge@osmocom.org>2020-08-13 05:36:26 +0000
commitf793a7e464742864245c0197ce9cad6a205c8936 (patch)
treebd6cc42082ccf9de465adb3f91b07a456ef63583 /library
parentdf65951d5cd4363aa18cfd8395bf259961b64de1 (diff)
comment: Osmocom_Types.ttcn: clarify f_rnd_int() return val
Diffstat (limited to 'library')
-rw-r--r--library/Osmocom_Types.ttcn3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn
index e55f1d6c..994a0cc7 100644
--- a/library/Osmocom_Types.ttcn
+++ b/library/Osmocom_Types.ttcn
@@ -49,7 +49,8 @@ module Osmocom_Types {
uint15_t arfcn
} with { variant "" };
- /* return random integer between 0 and max */
+ /* return random integer 0 <= ret < max. According to ETSI ES 201 873 C.6.1, rnd() returns *less* than 1, so
+ * the returned int will always be ret < max, or ret <= (max-1). */
function f_rnd_int(integer max) return integer {
return float2int(rnd()*int2float(max));
}