public static Half NextHalf(
this Random random,
Half minValue,
Half maxValue,
FloatScale scale = FloatScale.Auto
)
<ExtensionAttribute>
Public Shared Function NextHalf (
random As Random,
minValue As Half,
maxValue As Half,
Optional scale As FloatScale = FloatScale.Auto
) As Half
public:
[ExtensionAttribute]
static Half NextHalf(
Random^ random,
Half minValue,
Half maxValue,
FloatScale scale = FloatScale::Auto
)
[<ExtensionAttribute>]
static member NextHalf :
random : Random *
minValue : Half *
maxValue : Half *
?scale : FloatScale
(* Defaults:
let _scale = defaultArg scale FloatScale.Auto
*)
-> Half
In most cases return value is less than maxValue. Return value can be equal to maxValue in very edge cases such as when minValue is equal to maxValue or when integer parts of both limits are beyond the precision of the Half type.
If scale is Auto, then the ForceLinear option is used.
Generating random numbers by this method on the logarithmic scale is about 3 times slower than on the linear scale.
ArgumentNullException | random is . |
ArgumentOutOfRangeException | maxValue is less than minValue -or- scale is not a valid value of FloatScale. |