Change in osmo-ttcn3-hacks[master]: comment: Osmocom_Types.ttcn: clarify f_rnd_int() return val

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Wed Aug 12 23:46:49 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19586 )


Change subject: comment: Osmocom_Types.ttcn: clarify f_rnd_int() return val
......................................................................

comment: Osmocom_Types.ttcn: clarify f_rnd_int() return val

Change-Id: I0841b037d39fcadb75e1c13cf97d22917b68e2aa
---
M library/Osmocom_Types.ttcn
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/86/19586/1

diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn
index e55f1d6..994a0cc 100644
--- a/library/Osmocom_Types.ttcn
+++ b/library/Osmocom_Types.ttcn
@@ -49,7 +49,8 @@
 		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));
 	}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19586
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0841b037d39fcadb75e1c13cf97d22917b68e2aa
Gerrit-Change-Number: 19586
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200812/07b80d5a/attachment.htm>


More information about the gerrit-log mailing list