Extensions.RandomNext(IMemory, Int32, Int32, Nullable<Int32>) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從屬性中產生隨機種子和數值。 若值非空值,模擬隨機值結果為:最小值 + (值 % (最大值 - 最小值))。 否則如果種子不是空的,隨機的種子就會被固定。
public static int RandomNext(this AdaptiveExpressions.Memory.IMemory memory, int min, int max, int? seed = default);
static member RandomNext : AdaptiveExpressions.Memory.IMemory * int * int * Nullable<int> -> int
<Extension()>
Public Function RandomNext (memory As IMemory, min As Integer, max As Integer, Optional seed As Nullable(Of Integer) = Nothing) As Integer
參數
- memory
- IMemory
記憶體狀態。
- min
- Int32
隨機數的包含性下界返回。
- max
- Int32
隨機數的排他上界被回傳。 最大值必須大於或等於最小值。
傳回
隨機種子和數值。