Difference between revisions of "Extensions.Util.GetRandomNumber"

From emotive
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE: '''GetRandomNumber'''}}Category:Util == Classification == {{ClassificationActivity | GetRandomNumber | Returns a random float | Term | Extensions.Ut...")
 
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
FloatTerm = Util.GetRandomNumber();
+
FloatTerm Util.GetRandomNumber();
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 20: Line 20:
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 +
/// Local Declarations
 +
 
Float Float1;
 
Float Float1;
  

Latest revision as of 04:34, 8 November 2018

Classification

Name GetRandomNumber
Short Description Returns a random float
Class Term
Extension OTX Util extension
Group Util related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

FloatTerm Util.GetRandomNumber();

Description

The OTX GetRandomNumber term is a FloatTerm that returns a random float greater than or equal to 0.0 and less than 1.0. The result shall be uniformly distributed.

Icons Note.png NOTE — the mechanism to get a random value depends on the runtime system. It's not guaranteed that the random value is a true random number.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Float A random float greater than or equal to 0.0 and less than 1.0

Properties

  • NONE

OTL Examples

/// Local Declarations

Float Float1;

/// Flow

Float1 = Util.GetRandomNumber();

See also

Compare
CopyByteField
IsInitialized
ListIndexOf
ListIndexOfAny
ListReverse
ListSort
Max
Min
StringFormat